Skip to content

Commit

Permalink
chore: add comments (#4534)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan authored Jan 1, 2025
1 parent 28a001c commit 48d21ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/proc/shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import (
)

const (
// defaultWrapUpTime is the default time to wait before calling wrap up listeners.
defaultWrapUpTime = time.Second
// why we use 5500 milliseconds is because most of our queue are blocking mode with 5 seconds
// defaultWaitTime is the default time to wait before force quitting.
// why we use 5500 milliseconds is because most of our queues are blocking mode with 5 seconds
defaultWaitTime = 5500 * time.Millisecond
)

Expand All @@ -29,8 +31,10 @@ var (

// ShutdownConf defines the shutdown configuration for the process.
type ShutdownConf struct {
// WrapUpTime is the time to wait before calling shutdown listeners.
WrapUpTime time.Duration `json:",default=1s"`
WaitTime time.Duration `json:",default=5.5s"`
// WaitTime is the time to wait before force quitting.
WaitTime time.Duration `json:",default=5.5s"`
}

// AddShutdownListener adds fn as a shutdown listener.
Expand Down

0 comments on commit 48d21ef

Please sign in to comment.