This commit is contained in:
M09Ic committed 2024-11-01 12:30:55 +08:00
1 parent 0c90a5fc03
commit 4249da17b4
1 file changed
+9
+9
View File
@@ -149,6 +149,15 @@ func Spray() {
}
ctx, canceler := context.WithTimeout(context.Background(), time.Duration(runner.Deadline)*time.Second)
go func() {
select {
case <-ctx.Done():
time.Sleep(10 * time.Second)
logs.Log.Errorf("deadline and timeout not work, hard exit!!!")
os.Exit(0)
}
}()
go func() {
exitChan := make(chan os.Signal, 2)
signal.Notify(exitChan, os.Interrupt, syscall.SIGTERM)