rufus-scheduler 3.9.0 → 3.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec5b405be33c70ef390f2d8c47be112c7cf05c32eda58a0a764bbf42fae1b5d6
4
- data.tar.gz: c03f4dc830c7041a530d899d69d91f7409ba481bbd12241152543b0eae20fc23
3
+ metadata.gz: a9db2ffb7b6d057285e7e5fe94a8d984931d59dcad6c73ddb4375888d23f67ce
4
+ data.tar.gz: 30a77e6df03c57cbebb532490f7c4162bc46a071f12eb55cab1d4e4a2a6f6f46
5
5
  SHA512:
6
- metadata.gz: e5d992e7ad0a23530320731348c3c890b90d0184851d7faf807a36e4c6dd5d879579a478478055beab569e14603f129a7ad15022f2bf6b297a3e9f27cb31fb4c
7
- data.tar.gz: 85be36f54b76add7704907a3a7d43339a392d49fc05e03b62dc28e20a88eeb03cd132f64e1f3a1378f2e6e3128d57fb7fa4fe6f6ccd89fdd8b1d24fe93312583
6
+ metadata.gz: 8a70f7d30cc73d68ad64ad2d774dc2422fc74487aa655ec8f1c97b465db07e243592015ff3d62f01354b5541fe611b3a505a5e90529048226305de7f800bba98
7
+ data.tar.gz: 6d5df01c2f1f0da7502fb82f81ec25d17f90c8c04eaf6f15fc389d9471145ba9ef30da50e2377744c7bb367fb5d4aeda469e8b8548b45894abd72a4ccb65d857
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ### rufus-scheduler 3.9.1 - released 2023-06-09
6
+
7
+ * Introduce :first_at_no_error option, austinarbor gh-342
8
+
9
+
5
10
  ### rufus-scheduler 3.9.0 - released 2023-06-02
6
11
 
7
12
  * Add note about Chronic and "Wed at 2pm", gh-340
data/CREDITS.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## Contributors
6
6
 
7
+ * Austin Arbor https://github.com/austinarbor gh-342 first_at_error
7
8
  * Bence Monus https://github.com/cromega gh-337 on_error and friends
8
9
  * Talia Wong https://github.com/blowfishpro gh-335 on_error and friends
9
10
  * Konstantin https://github.com/fa11enangel gh-334 nodejitsu link
@@ -72,6 +73,7 @@
72
73
 
73
74
  ## Feedback
74
75
 
76
+ * jasonwbarnett (https://github.com/jaswonwbarnett) past time jobs, gh-339
75
77
  * aphel (https://github.com/itsaphel) #shutdown vs current thread, gh-304
76
78
  * aesyondu (https://github.com/aesyondu) Rails console 4.2.x, gh-186
77
79
  * Sasha Hoellger (https://github.com/mitnal) parse_cron and readme, gh-270
data/README.md CHANGED
@@ -515,6 +515,18 @@ that'll output something like:
515
515
  ...
516
516
  ```
517
517
 
518
+ ### :first_at_no_error
519
+
520
+ In some heavy-duty configurations, the `:first_at` setting might be set on a point of time before the actual scheduling/triggering occurs and will result in an error `"cannot set first[_at|_in] in the past..."`. To prevent that, the `:first_at_no_error` option may be set to true.
521
+
522
+ ```ruby
523
+ scheduler.every '10h', first_at: Time.now + 10, first_at_no_error: true do
524
+ # ...
525
+ end
526
+ ```
527
+
528
+ As introduced in [gh-342](https://github.com/jmettraux/rufus-scheduler/pull/342).
529
+
518
530
  ### :last_at, :last_in, :last
519
531
 
520
532
  This option is for repeat jobs (cron / every) only.
@@ -1646,6 +1658,26 @@ require 'tzinfo/data'
1646
1658
  require 'rufus-scheduler'
1647
1659
  ```
1648
1660
 
1661
+ ### Timezone in the schedule thread
1662
+
1663
+ Currently (3.9.x), rufus-scheduler strives to trigger at the right time. The trigger thread might not yield a `Time.now` in the scheduled timezone.
1664
+
1665
+ ```ruby
1666
+ ENV['TZ'] = 'Asia/Tokyo'
1667
+
1668
+ require 'rufus-scheduler'
1669
+
1670
+ s = Rufus::Scheduler.new
1671
+
1672
+ s.cron('*/5 * * * * * Europe/Rome') do
1673
+ p Time.now # ==> the representation will indicate the time is UTC+0900...
1674
+ end
1675
+
1676
+ s.join
1677
+ ```
1678
+
1679
+ In the wake of [gh-341](https://github.com/jmettraux/rufus-scheduler/issues/341).
1680
+
1649
1681
 
1650
1682
  ## so Rails?
1651
1683
 
@@ -15,6 +15,8 @@ class Rufus::Scheduler::RepeatJob < Rufus::Scheduler::Job
15
15
 
16
16
  @times = opts[:times]
17
17
 
18
+ @first_at_no_error = opts[:first_at_no_error] || false
19
+
18
20
  fail ArgumentError.new(
19
21
  "cannot accept :times => #{@times.inspect}, not nil or an int"
20
22
  ) unless @times == nil || @times.is_a?(Integer)
@@ -43,6 +45,7 @@ class Rufus::Scheduler::RepeatJob < Rufus::Scheduler::Job
43
45
 
44
46
  @first_at = (fdur && (EoTime.now + fdur)) || EoTime.make(first)
45
47
  @first_at = n1 if @first_at >= n0 && @first_at < n1
48
+ @first_at = n0 if @first_at < n0 && @first_at_no_error
46
49
 
47
50
  fail ArgumentError.new(
48
51
  "cannot set first[_at|_in] in the past: " +
@@ -319,4 +322,3 @@ class Rufus::Scheduler::CronJob < Rufus::Scheduler::RepeatJob
319
322
  end
320
323
  end
321
324
  end
322
-
@@ -9,7 +9,7 @@ module Rufus; end
9
9
 
10
10
  class Rufus::Scheduler
11
11
 
12
- VERSION = '3.9.0'
12
+ VERSION = '3.9.1'
13
13
 
14
14
  EoTime = ::EtOrbi::EoTime
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-02 00:00:00.000000000 Z
11
+ date: 2023-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fugit