Releases: go-co-op/gocron
Releases · go-co-op/gocron
v0.7.1
Fixed
Clear()
now properly stops all jobs before removing them from the scheduler (#134) @JohnRoesler
Chores
- Updated the readme with details around different job modes and combinations of schedule options (2a8757a) @JohnRoesler
v0.7.0
Added
- singleflight mode, if the same job tries to run again while a previous run hasn't finished yet, it will either wait to run or skip the run (#123) thanks @farwydi
- the ability to limit the number of concurrent jobs, useful for resource intensive jobs (#126) thanks @dustin-decker
Changed
- we now send jobs to a job executor through channels instead of handling them directly in the scheduler, allowing us to get rid of many mutexes (#122) @JohnRoesler
Fixed
- a race condition issue on some getter methods (#124) thanks @amirhosseinvz94
v0.6.0
Added
- allow starting Jobs at a date in the past (#113) @calvinmclean
- add job limit and remove after last run to scheduler chain (#116) @JohnRoesler
scheduler.Every()
now accepts int, time.Duration, and string to allow any desired duration between runs (#119) @JohnRoesler
Changed
- sets the default unit to seconds (#112) @JohnRoesler
- catches a bad interval of 0 with an error (#112) @JohnRoesler
- clarified several function names and accepted values (#121) @JohnRoesler
- The job
Tag
func now accepts a variadic string parameter instead of a slice - The scheduler
SetTag
is nowTag
and also accepts a variadic string parameter - The scheduler
RemoveJobByTag
is nowRemoveByTag
to be consistent withRemove
andRemoveByReference
- The scheduler
RunAllWithDelay
func now accepts a time.Duration instead of an int representing seconds - The scheduler
Scheduled
func is nowTaskPresent
- scheduled was confusing name because until the scheduler is started, it's not actually "scheduled to run". Now you can check whether the task is present in the scheduler.
- The job
Fixed
- fixed the bug with jobs not being stopped upon removal (5027f53) thanks @huage1994
- catches nil timer with stopTimer() func (#112) @JohnRoesler
- fix a bug where the monthly calculation failed rounding to midnight (#104) @sdw2330976
- fix bug with limit runs to not stopping jobs (#114) @JohnRoesler
Removed
- remove stopChan from Scheduler (#105) @arjunmahishi
Chores
- documentation clean up (#112) @JohnRoesler
- add golangci to actions - and address lint issues (#117) (#118) @JohnRoesler
- add examples for all funcs to godoc (#121) @JohnRoesler
v0.5.1
Fixed
- fix bug with StartAt() in v0.5.0 (#103) @JohnRoesler
v0.5.0 - DO NOT USE
❗ A bug was discovered and patched in v0.5.1
Added
- func to remove a particular job reference from the scheduler after the last execution of the job (#90) - thanks @dlaweb
Changed
Fixed
- ran go test -race and cleans up all the race conditions (#92) @JohnRoesler
- add mutex to scheduler location (#93) @JohnRoesler
Removed
- removed the deprecated StartImmediately() func (#92) @JohnRoesler
Chores
- added a makefile to enable easy fmt checks, lint, vet, test -race (#92) @JohnRoesler
- Add a contributing md (#94) @JohnRoesler
Expose job data, bugfixes, start immediately default
Added
- Expose the Job's lastRun, nextRun and runCount (#83) @arjunmahishi
Changed
scheduleNextRun
now uses duration (#79) @Streppel- Start jobs immediately by default -
StartImmediately()
has been deprecated (#82) @JohnRoesler- To achieve the prior behavior of starting after the interval, use
StartAt()
s := gocron.NewScheduler(time.UTC) _, _ = s.Every(1).Hour().StartAt(time.Now().Add(time.Hour() * 1)).Do(task) s.StartBlocking()
- To achieve the prior behavior of starting after the interval, use
Fixed
- Re-set the job's last run in scheduler run() (#81) @JohnRoesler
- Fix runnableJobs where subsequent jobs are never checked (#87) @JohnRoesler
- Handle job creation errors (#89) @arjunmahishi
Removed
Chores
- Add funding doc d12fdaf b7cd523 😃 @JohnRoesler
Fix race conditions in job counter
Fixed
- Resolve race conditions that may arise with the job counter being incremented and referenced in different go routines #74
Bugfixes
Add Monthly option and update At() func
Fix bug in removeByCondition
Fixed
- Fixed a bug in the removeByCondition func trying to access elements outside the slice range #46 - thank you @ridwanakf for your contribution!