Skip to content

Commit

Permalink
Merge pull request #29 from kuzxnia/run_with_progress
Browse files Browse the repository at this point in the history
fix progress exit
  • Loading branch information
kuzxnia authored Feb 21, 2024
2 parents 38a0df7 + e1b32f1 commit ac23513
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lbot/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func (p *ProgressProcess) Run(request *proto.ProgressRequest, srv proto.Progress
return !worker.IsDone()
})
for range ticker.C {
select {
case <-p.lbot.done:
fmt.Println("workload done")
done <- true
default:
}
for _, w := range notDoneWorkers {
isWorkerFinished := w.IsDone()
resp := proto.ProgressResponse{
Expand All @@ -62,12 +68,6 @@ func (p *ProgressProcess) Run(request *proto.ProgressRequest, srv proto.Progress
return !worker.IsDone()
})
}
select {
case <-p.lbot.done:
fmt.Println("workload done")
done <- true
default:
}

}
}
Expand Down

0 comments on commit ac23513

Please sign in to comment.