Skip to content

Releases: go-co-op/gocron

v0.7.1

05 Mar 04:48
88f1ca4
Compare
Choose a tag to compare
v0.7.1 Pre-release
Pre-release

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

26 Feb 19:03
f251977
Compare
Choose a tag to compare
v0.7.0 Pre-release
Pre-release

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

v0.6.0

09 Feb 15:36
507947a
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release

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 now Tag and also accepts a variadic string parameter
    • The scheduler RemoveJobByTag is now RemoveByTag to be consistent with Remove and RemoveByReference
    • The scheduler RunAllWithDelay func now accepts a time.Duration instead of an int representing seconds
    • The scheduler Scheduled func is now TaskPresent - 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.

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

Chores

v0.5.1

15 Jan 16:27
e0835f6
Compare
Choose a tag to compare
v0.5.1 Pre-release
Pre-release

Fixed

v0.5.0 - DO NOT USE

31 Dec 21:13
7eacf6d
Compare
Choose a tag to compare
v0.5.0 - DO NOT USE Pre-release
Pre-release

❗ 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

  • refactor scheduler to schedule jobs with time.AfterFunc() (#99) @Streppel

Fixed

Removed

Chores

Expose job data, bugfixes, start immediately default

11 Dec 20:01
5ed8230
Compare
Choose a tag to compare

Added

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()
      

Fixed

Removed

Chores

Fix race conditions in job counter

10 Nov 05:11
0969260
Compare
Choose a tag to compare
Pre-release

Fixed

  • Resolve race conditions that may arise with the job counter being incremented and referenced in different go routines #74

Bugfixes

03 Nov 13:42
daf5304
Compare
Choose a tag to compare
Bugfixes Pre-release
Pre-release

Added

  • Add a new Job method called 'LimitRunsTo' (#67)

Changed

  • rewriting scheduler logic (#54)
  • regex for at time accepts time without leading zeros (#56)

Fixed

  • Make sure Do() does not override the nextRun time when StartAt() is used (#49)
  • scheduler schedules jobs registration when already running (#61)

Chores

  • Add godoc badge to README (#51)
  • removing legacy deterministic tests (#62)
  • Add examples from README to example_test.go (#66)
  • add go 1.15 to testing matrix and remove 1.13 (#68)

Add Monthly option and update At() func

21 Jul 19:40
3f4608d
Compare
Choose a tag to compare
Pre-release

Added

  • Add Monthly() frequency #47

Changed

  • Changed the At() func to parse using time.Parse instead of Atoi #48

Fix bug in removeByCondition

16 Jul 15:29
5af127a
Compare
Choose a tag to compare
Pre-release

Fixed

  • Fixed a bug in the removeByCondition func trying to access elements outside the slice range #46 - thank you @ridwanakf for your contribution!