Skip to content

Commit

Permalink
expand documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Apr 29, 2023
1 parent 858e239 commit bfcf69a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,15 @@ func (s *Scheduler) StopBlockingChan() {
// WithDistributedLocker prevents the same job from being run more than once
// when multiple schedulers are trying to schedule the same job.
//
// NOTE - this does NOT work with jobs using any of the limiting functions:
// One strategy to reduce splay in the job execution times when using
// intervals (e.g. 1s, 1m, 1h), on each scheduler instance, is to use
// StartAt with time.Now().Round(interval) to start the job at the
// next interval boundary.
//
// Another strategy is to use the Cron or CronWithSeconds methods as they
// use the same behavior described above using StartAt.
//
// NOTE - the Locker will NOT lock jobs using any of the limiting functions:
// SingletonMode, SingletonModeAll or SetMaxConcurrentJobs
func (s *Scheduler) WithDistributedLocker(l Locker) {
s.executor.distributedLocker = l
Expand Down

0 comments on commit bfcf69a

Please sign in to comment.