Skip to content

Commit

Permalink
show warning when max running jobs limit has been reached
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Oct 2, 2020
1 parent 3a83a62 commit 1318bf6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ func (s *Scheduler) runOnce(ctx context.Context) bool {
// Wait for semaphore
select {
case s.maxRunning <- struct{}{}:
case <-ctx.Done():
return false
default:
log.Printf("max running jobs (%d) has been reached", cap(s.maxRunning))
}
select {
case s.maxRunning <- struct{}{}:
case <-ctx.Done():
return false
}
Expand Down

0 comments on commit 1318bf6

Please sign in to comment.