From f8e189c968bf410a346eed46ebbf81e5a570c7b9 Mon Sep 17 00:00:00 2001 From: Masahiro Nagano Date: Sat, 25 Nov 2023 14:19:39 +0900 Subject: [PATCH] Revert "graceful stop" --- bench/cmd/bench/supervise.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bench/cmd/bench/supervise.go b/bench/cmd/bench/supervise.go index 27a98e467..e381dfe29 100644 --- a/bench/cmd/bench/supervise.go +++ b/bench/cmd/bench/supervise.go @@ -355,11 +355,10 @@ var supervise = cli.Command{ } } jobCh := portal.StartReceiveJob(ctx) - jobWaitCh := make(chan struct{}, 1) + for { select { case <-ctx.Done(): - <-jobWaitCh return cli.NewExitError(ctx.Err(), 1) case job := <-jobCh: log.Printf("receive job = %+v\n", job) @@ -385,7 +384,7 @@ var supervise = cli.Command{ } log.Println("execute benchmark") - result, err := execBench(context.Background(), job) + result, err := execBench(ctx, job) if err != nil { NotifyWorkerErr(job, err, "", "", "ベンチマーカーの実行に失敗。すぐに調査してください。supervisorの処理は継続します") } @@ -405,7 +404,6 @@ var supervise = cli.Command{ os.Remove(config.StaffLogPath) os.Remove(config.ContestantLogPath) os.Remove(config.ResultPath) - jobWaitCh <- struct{}{} } } }