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 +4 -4
- data/CHANGELOG.md +5 -0
- data/CREDITS.md +2 -0
- data/README.md +32 -0
- data/lib/rufus/scheduler/jobs_repeat.rb +3 -1
- data/lib/rufus/scheduler.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9db2ffb7b6d057285e7e5fe94a8d984931d59dcad6c73ddb4375888d23f67ce
|
4
|
+
data.tar.gz: 30a77e6df03c57cbebb532490f7c4162bc46a071f12eb55cab1d4e4a2a6f6f46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a70f7d30cc73d68ad64ad2d774dc2422fc74487aa655ec8f1c97b465db07e243592015ff3d62f01354b5541fe611b3a505a5e90529048226305de7f800bba98
|
7
|
+
data.tar.gz: 6d5df01c2f1f0da7502fb82f81ec25d17f90c8c04eaf6f15fc389d9471145ba9ef30da50e2377744c7bb367fb5d4aeda469e8b8548b45894abd72a4ccb65d857
|
data/CHANGELOG.md
CHANGED
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
|
-
|
data/lib/rufus/scheduler.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fugit
|