Skip to content

Commit

Permalink
fix interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mashiike committed Jun 14, 2022
1 parent 60c49e7 commit a7b4e6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/gdnotify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ func _main() error {
if minLevel == "debug" {
log.SetFlags(log.Lshortfile)
}

ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT, syscall.SIGHUP)
defer cancel()
cfg := gdnotify.DefaultConfig()
if err := cfg.Load(configs...); err != nil {
if err := cfg.Load(ctx, configs...); err != nil {
return err
}
if err := cfg.ValidateVersion(Version); err != nil {
Expand All @@ -96,8 +97,7 @@ func _main() error {
if command := flag.Arg(0); command != "" {
optFns = append(optFns, gdnotify.WithCLICommand(command))
}
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT, syscall.SIGHUP)
defer cancel()

if err := app.RunWithContext(ctx, optFns...); err != nil {
return err
}
Expand Down

0 comments on commit a7b4e6a

Please sign in to comment.