Skip to content

Commit

Permalink
changes wait to a constant for now
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k authored and dougbtv committed Sep 19, 2024
1 parent aa7e69f commit 6eddddb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/multus-daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
)

// SigtermCancelAfter sets the wait time to cancel after sig term

Check warning on line 45 in cmd/multus-daemon/main.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

comment on exported const SigTermCancelAfter should be of the form "SigTermCancelAfter ..."

Check warning on line 45 in cmd/multus-daemon/main.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

comment on exported const SigTermCancelAfter should be of the form "SigTermCancelAfter ..."
// TODO: This could be a configuration option
const SigTermCancelAfter = 10 * time.Second

func main() {
flag.CommandLine = flag.NewFlagSet(os.Args[0], flag.ExitOnError)

Expand Down Expand Up @@ -132,8 +136,7 @@ func main() {
for sig := range signalCh {
logging.Verbosef("caught %v, stopping...", sig)
sigTermCancel()
// TODO be configurable
<-time.After(10 * time.Second)
<-time.After(SigTermCancelAfter)
cancel()
}
}()
Expand Down

0 comments on commit 6eddddb

Please sign in to comment.