Skip to content

Commit

Permalink
Revert "graceful stop"
Browse files Browse the repository at this point in the history
  • Loading branch information
kazeburo authored Nov 25, 2023
1 parent e03f75f commit f8e189c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bench/cmd/bench/supervise.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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の処理は継続します")
}
Expand All @@ -405,7 +404,6 @@ var supervise = cli.Command{
os.Remove(config.StaffLogPath)
os.Remove(config.ContestantLogPath)
os.Remove(config.ResultPath)
jobWaitCh <- struct{}{}
}
}
}
Expand Down

0 comments on commit f8e189c

Please sign in to comment.