diff --git a/README.md b/README.md index dba48b1c..2e50f227 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,12 @@ For more examples, take a look in our [go docs](https://pkg.go.dev/github.com/go There are several options available to restrict how jobs run: -| Mode | Function | Behavior | -|---------------------|---------------------------|------------------------------------------------------------------------------------------------------| -| Default | | jobs are rescheduled at every interval | -| Job singleton | `SingletonMode()` | a long running job will not be rescheduled until the current run is completed | -| Scheduler limit | `SetMaxConcurrentJobs()` | set a collective maximum number of concurrent jobs running across the scheduler | -| Distributed locking | `WithDistributedLocker()` | prevents the same job from being run more than once when running multiple instances of the scheduler | +| Mode | Function | Behavior | +|----------------------------|---------------------------|------------------------------------------------------------------------------------------------------| +| Default | | jobs are rescheduled at every interval | +| Job singleton | `SingletonMode()` | a long running job will not be rescheduled until the current run is completed | +| Scheduler limit | `SetMaxConcurrentJobs()` | set a collective maximum number of concurrent jobs running across the scheduler | +| Distributed locking (BETA) | `WithDistributedLocker()` | prevents the same job from being run more than once when running multiple instances of the scheduler | ## Tags @@ -117,8 +117,9 @@ s.RunByTag("tag") ## FAQ - Q: I'm running multiple pods on a distributed environment. How can I make a job not run once per pod causing duplication? - - A: Use the scheduler option `WithDistributedLocker` and either use an implemented backend or implement your own - - and contribute it back in a PR (we hope)! + - We recommend using your own lock solution within the jobs themselves (you could use [Redis](https://redis.io/topics/distlock), for example) + - A2: Currently in BETA (please provide feedback): Use the scheduler option `WithDistributedLocker` and either use an implemented backend + or implement your own and contribute it back in a PR (we hope)! - Q: I've removed my job from the scheduler, but how can I stop a long-running job that has already been triggered? - A: We recommend using a means of canceling your job, e.g. a `context.WithCancel()`. diff --git a/scheduler.go b/scheduler.go index c2566cdf..bb9e0161 100644 --- a/scheduler.go +++ b/scheduler.go @@ -1389,6 +1389,9 @@ 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 is currently in BETA. Please provide any feedback on your usage +// and open bugs with any issues. +// // 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