sidetiq 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe87e48535b00a33d15395b564b62fce3a4ed68d
4
- data.tar.gz: 1cb3287fdd6312b1792c11d46561b495cba27114
3
+ metadata.gz: d5176aed9abba4157c9913ff2b421ae5c355e1d3
4
+ data.tar.gz: 1a6f8f296756a2f8b86d7bd2583e95aedbf3f530
5
5
  SHA512:
6
- metadata.gz: 040024621688bf956b27cee9f85235d348886e09d315cd07ada3c85faa991f02068a3e37b705307aac499aef0b7dc0f6cbaef498271149dab602a50e04a2a9e5
7
- data.tar.gz: 6de537a1815d7cf3a1e3830efd36883b84a79ff034f54012d7c63ca809eddac5ec7e8315c0b291889cade9b63e4d73aa604606553c10116045c60cc79e9f65f2
6
+ metadata.gz: 52b4e965ffad546335b40203c8fb93be9d45659736b37e207f26a41954fb3db999b5b1bd0cd0f9b3ef06bccca8f24ffe6e772fe1ee22c441cef99697cb3086d6
7
+ data.tar.gz: 2dd87568bbda265f76e7bd061e2044b404f08242bee266ff4086fdc994c8c22ce866a4ba969bfcd34f189bd267676004517eac977a8185035d865e4690143656
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ 0.3.3
2
+ -----
3
+
4
+ - Deprecate Sidekiq::Schedulable.tiq in favor of .recurrence.
5
+ Sidekiq::Schedulable.tiq will still work until v0.4.0 but log
6
+ a deprecation warning.
7
+
1
8
  0.3.2
2
9
  -----
3
10
 
data/README.md CHANGED
@@ -71,7 +71,7 @@ class MyWorker
71
71
  include Sidetiq::Schedulable
72
72
 
73
73
  # Daily at midnight
74
- tiq { daily }
74
+ recurrence { daily }
75
75
 
76
76
  def perform
77
77
  # do stuff ...
@@ -86,7 +86,7 @@ class MyWorker
86
86
  include Sidekiq::Worker
87
87
  include Sidetiq::Schedulable
88
88
 
89
- tiq do
89
+ recurrence do
90
90
  # Every third year in March
91
91
  yearly(3).month_of_year(:march)
92
92
 
@@ -108,7 +108,7 @@ class MyWorker
108
108
  include Sidetiq::Schedulable
109
109
 
110
110
  # Every other month on the first monday and last tuesday at 12 o'clock.
111
- tiq { monthly(2).day_of_week(1 => [1], 2 => [-1]).hour_of_day(12) }
111
+ recurrence { monthly(2).day_of_week(1 => [1], 2 => [-1]).hour_of_day(12) }
112
112
 
113
113
  def perform
114
114
  # do stuff ...
@@ -125,7 +125,7 @@ class MyWorker
125
125
  include Sidekiq::Worker
126
126
  include Sidetiq::Schedulable
127
127
 
128
- tiq { daily }
128
+ recurrence { daily }
129
129
 
130
130
  # Receive last and current occurrence times.
131
131
  def perform(last_occurrence, current_occurrence)
@@ -152,7 +152,7 @@ Backfills
152
152
 
153
153
  In certain cases it is desirable that missed jobs will be enqueued
154
154
  retroactively, for example when a critical, hourly job isn't run due to
155
- server downtime. To solve this, `#tiq` takes a *backfill* option. If
155
+ server downtime. To solve this, `#recurrence` takes a *backfill* option. If
156
156
  missing job occurrences have been detected, Sidetiq will then enqueue
157
157
  the jobs automatically. It will also ensure that the timestamps passed to
158
158
  `#perform` are as expected:
@@ -162,7 +162,7 @@ class MyWorker
162
162
  include Sidekiq::Worker
163
163
  include Sidetiq::Schedulable
164
164
 
165
- tiq backfill: true do
165
+ recurrence backfill: true do
166
166
  hourly
167
167
  end
168
168
 
@@ -219,7 +219,8 @@ Sidetiq.schedules
219
219
  ```
220
220
 
221
221
  `Sidetiq.workers` returns an `Array` of all workers currently tracked by
222
- Sidetiq (workers which include `Sidetiq::Schedulable` and a `.tiq` call):
222
+ Sidetiq (workers which include `Sidetiq::Schedulable` and a `.recurrence`
223
+ call):
223
224
 
224
225
  ```ruby
225
226
  Sidetiq.workers
@@ -285,7 +286,7 @@ class MyWorker
285
286
  include Sidekiq::Worker
286
287
  include Sidetiq::Schedulable
287
288
 
288
- tiq { minutely(15) }
289
+ recurrence { minutely(15) }
289
290
  end
290
291
  ```
291
292
 
@@ -296,7 +297,7 @@ class MyWorker
296
297
  include Sidekiq::Worker
297
298
  include Sidetiq::Schedulable
298
299
 
299
- tiq { hourly.minute_of_hour(0, 15, 30, 45) }
300
+ recurrence { hourly.minute_of_hour(0, 15, 30, 45) }
300
301
  end
301
302
  ```
302
303
 
data/examples/simple.rb CHANGED
@@ -13,7 +13,7 @@ class MyWorker
13
13
  include Sidekiq::Worker
14
14
  include Sidetiq::Schedulable
15
15
 
16
- tiq { secondly }
16
+ recurrence { secondly }
17
17
 
18
18
  def perform(*args)
19
19
  Sidekiq.logger.info "#perform"
@@ -22,7 +22,14 @@ module Sidetiq
22
22
  get_timestamp "next"
23
23
  end
24
24
 
25
- def tiq(options = {}, &block) # :nodoc:
25
+ def tiq(*args, &block) # :nodoc:
26
+ Sidetiq.logger.warn "DEPRECATION WARNING: Sidetiq::Schedulable#tiq" <<
27
+ " is deprecated and will be removed. Use" <<
28
+ " Sidetiq::Schedulable#recurrence instead."
29
+ recurrence(*args, &block)
30
+ end
31
+
32
+ def recurrence(options = {}, &block) # :nodoc:
26
33
  clock = Sidetiq::Clock.instance
27
34
  clock.synchronize do
28
35
  schedule = clock.schedule_for(self)
@@ -8,7 +8,7 @@ module Sidetiq
8
8
  MINOR = 3
9
9
 
10
10
  # Public: Sidetiq patch level.
11
- PATCH = 2
11
+ PATCH = 3
12
12
 
13
13
  # Public: String representation of the current Sidetiq version.
14
14
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
@@ -2,7 +2,7 @@ class BackfillWorker
2
2
  include Sidekiq::Worker
3
3
  include Sidetiq::Schedulable
4
4
 
5
- tiq backfill: true do
5
+ recurrence backfill: true do
6
6
  daily
7
7
  end
8
8
 
@@ -2,7 +2,7 @@ class ScheduledWorker
2
2
  include Sidekiq::Worker
3
3
  include Sidetiq::Schedulable
4
4
 
5
- tiq do
5
+ recurrence do
6
6
  daily.hour_of_day(1)
7
7
  yearly.month_of_year(2)
8
8
  monthly.day_of_month(3)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidetiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Svensson