mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-27 04:07:28 +00:00
core: Eliminate unnecessary shutdown delay on Unix (#5413)
* core: Eliminate unnecessary shutdown delay on Unix Fix #5393, alternate to #5405 * Comments, cleanup, adjust logs * Fix build constraint
This commit is contained in:
parent
85375861f6
commit
99d47050e9
4 changed files with 36 additions and 13 deletions
|
|
@ -517,7 +517,7 @@ func (app *App) Stop() error {
|
|||
|
||||
// honor scheduled/delayed shutdown time
|
||||
if delay {
|
||||
app.logger.Debug("shutdown scheduled",
|
||||
app.logger.Info("shutdown scheduled",
|
||||
zap.Duration("delay_duration", time.Duration(app.ShutdownDelay)),
|
||||
zap.Time("time", scheduledTime))
|
||||
time.Sleep(time.Duration(app.ShutdownDelay))
|
||||
|
|
@ -528,9 +528,9 @@ func (app *App) Stop() error {
|
|||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Duration(app.GracePeriod))
|
||||
defer cancel()
|
||||
app.logger.Debug("servers shutting down; grace period initiated", zap.Duration("duration", time.Duration(app.GracePeriod)))
|
||||
app.logger.Info("servers shutting down; grace period initiated", zap.Duration("duration", time.Duration(app.GracePeriod)))
|
||||
} else {
|
||||
app.logger.Debug("servers shutting down with eternal grace period")
|
||||
app.logger.Info("servers shutting down with eternal grace period")
|
||||
}
|
||||
|
||||
// goroutines aren't guaranteed to be scheduled right away,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue