Update On Fri Mar 22 14:55:22 CET 2024

This commit is contained in:
github-action[bot]
2024-03-22 14:55:23 +01:00
parent 181f63e0d6
commit d434d36c9f
258 changed files with 8848 additions and 2580 deletions

View File

@@ -1,9 +1,7 @@
package cli
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
@@ -20,19 +18,14 @@ func startAction(ctx *cli.Context) error {
cliLogger.Fatalf("InitConfigAndComponents meet err=%s", err.Error())
}
mainCtx, cancel := context.WithCancel(ctx.Context)
defer cancel()
exitSigs := make(chan os.Signal, 1)
signal.Notify(exitSigs, syscall.SIGINT, syscall.SIGTERM)
mainCtx, stop := signal.NotifyContext(ctx.Context, syscall.SIGINT, syscall.SIGTERM)
defer stop()
MustStartComponents(mainCtx, cfg)
// wait for exit
select {
case <-mainCtx.Done():
case <-exitSigs:
}
cliLogger.Infof("ehco exit now...")
<-mainCtx.Done()
cliLogger.Info("ehco exit now...")
return nil
}