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 3a4a8b5
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 @@ -107,6 +107,13 @@ func (s *Scheduler) runOnce(ctx context.Context) bool {
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
}
}
}
s.wg.Add(1)
Expand Down

0 comments on commit 3a4a8b5

Please sign in to comment.