mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-22 11:09:02 -05:00
set default timeouts and clean up
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
9a3fc08dd4
commit
c597dfb917
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user