Skip to content

Commit

Permalink
fix: config
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Dec 25, 2024
1 parent 62da33b commit c1204e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/api/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ func Start(ctx context.Context, index int, config *Config) error {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGTERM)

ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
shutdown := func() error {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
err := server.Shutdown(ctx)
if err != nil {
return errs.WrapMsg(err, "shutdown err")
}
return nil
}
disetcd.RegisterShutDown(shutdown)
defer cancel()
select {
case <-sigs:
program.SIGTERMExit()
Expand Down

0 comments on commit c1204e3

Please sign in to comment.