set default timeouts and clean up

This commit is contained in:
Roman Perekhod
2025-05-27 13:02:34 +02:00
committed by Jörn Friedrich Dreyer
parent 9a3fc08dd4
commit c597dfb917
40 changed files with 75 additions and 70 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ func NewGolangHttpServerRunner(name string, server *http.Server, opts ...Option)
}, func() {
// Since Shutdown might take some time, don't block
go func() {
// TODO: Provide the adjustable TimeoutDuration
// Use the DefaultInterruptDuration or InterruptDuration as the shutdown timeout.
shutdownCtx, cancel := context.WithTimeout(context.Background(), DefaultInterruptDuration)
defer cancel()
+1 -1
View File
@@ -21,7 +21,7 @@ import (
//
// The interrupt duration for the group can be set through the
// `WithInterruptDuration` option. If the option isn't supplied, the default
// value (15 secs) will be used.
// value `DefaultGroupInterruptDuration` will be used.
//
// It's recommended that the timeouts are handled by each runner individually,
// meaning that each runner's timeout should be less than the group runner's
+1 -1
View File
@@ -32,7 +32,7 @@ type Runner struct {
//
// The interrupt duration, which can be set through the `WithInterruptDuration`
// option, will be used to ensure the runner doesn't block forever. If the
// option isn't supplied, the default value (10 secs) will be used.
// option isn't supplied, the default value `DefaultInterruptDuration` will be used.
// The interrupt duration will be used to start a timeout when the
// runner gets interrupted (either the context of the `Run` method is done
// or this runner's `Interrupt` method is called). If the timeout is reached,