resque-scheduler 4.3.0 → 4.3.1

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.

Potentially problematic release.


This version of resque-scheduler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f23ec3da33d013e1f2f778c80cecc99d94c319d0
4
- data.tar.gz: 4d7773093114491ece8819542b74f0458bd8549c
3
+ metadata.gz: 52d400f5dbdd7e1d642466e7999f6ec7f6805355
4
+ data.tar.gz: 7caa30cc7095a5451f915a981b64cd0dda7149e5
5
5
  SHA512:
6
- metadata.gz: 95d9504189a959f3f409cb625f2a83d2b8cb4e90be3fed271cc9fd6bdac2e4f3b1fe2e81560cf8d7e72cfbc6b9ea3f910eaeb0283401d026afe9ecad4ee23dc5
7
- data.tar.gz: 6b919517498d28e9f4b6ca4dda8629f801c0e3cd035932191afdd64cd1edbe4a3191fd93abf2c2f323d1944d6b80835517057ce4ecbf2433e674f1339a74c253
6
+ metadata.gz: 20630b816c225504beb88315ef1df2fa1672e44e05c6386446c53e6b5422ab7b1cf478775f6660e7f880a73771f073746fb0853258a5ad71f450b51e15290ce2
7
+ data.tar.gz: 8fa83bedc4ffd9759d5390ad19ce82b8188445df3aa5c46ac2a32dc8a162e66c69c73f4599ad90ea4a3eb2191661fe82ece5aea30bd834d3e9e8495267e84a7b
@@ -0,0 +1,457 @@
1
+ # Change Log
2
+
3
+ **ATTN**: This project uses [semantic versioning](http://semver.org/).
4
+
5
+ ## [Unreleased]
6
+ ### Changed
7
+ - Add support and testing for ruby 2.4
8
+ - Change log format and file name
9
+ - Drop testing on ruby 1.9.3
10
+ - `Lock::Resilient`: Refresh lua script sha if it does not exist in redis server
11
+
12
+ ### Fixed
13
+ - Reporting version via `resque-scheduler --version`
14
+
15
+ ## [4.3.0] - 2016-06-26
16
+ ### Added
17
+ - Windows testing on Appveyor
18
+ - Code of Conduct
19
+
20
+ ### Changed
21
+ - Silence output by default when daemonizing
22
+ - Update vagrant setup
23
+ - Update gem metadata per latest Bundler defaults
24
+
25
+ ## [4.2.1] - 2016-06-08
26
+ ### Added
27
+ - Docs improvements
28
+
29
+ ### Changed
30
+ - Optimization of `find_delayed_selection`
31
+ - More defensive code around redis disconnects
32
+ - Only trap existing signals on given platform
33
+ - RuboCop auto-fixes
34
+ - Dependency updates
35
+
36
+ ## [4.2.0] - 2016-04-29
37
+ ### Added
38
+ - Index column to scheduler tab
39
+ - Failure hook support for better extensibility
40
+
41
+ ### Changed
42
+ - Clean up and simplify the scheduling extension
43
+ - Make `Resque::Scheduler.logger` accessible to user
44
+ - Default failure handler now outputs stacktrace
45
+ - Update rufus-scheduler
46
+
47
+ ### Fixed
48
+ - Displaying schedules appropriate to the `env` in scheduler UI
49
+ - A race condition in concurrent restarts
50
+
51
+ ## [4.1.0] - 2016-02-10
52
+ ### Added
53
+ - View helper to cut down on repetition
54
+ - `Resque.(find|enqueue)_delayed_selection` methods to complement
55
+ `Resque.remove_delayed_selection`
56
+
57
+ ### Changed
58
+ - Leave undefined env vars unset in internal options hash
59
+ - Insulate checking `Rails.env`
60
+ - Documentation updates and typo fixes
61
+
62
+ ### Fixed
63
+ - Check thread life only if present
64
+
65
+ ## [4.0.0] - 2014-12-21
66
+ ### Added
67
+ - Show current master in the web UI
68
+
69
+ ### Changed
70
+ - Bump rufus-scheduler dependency to `~> 3.0`
71
+ - Address warning from redis-namespace related to `#unwatch`
72
+ - Documentation updates
73
+
74
+ ### Fixed
75
+ - Bugfix related to schedule check when no jobs are in the queue
76
+
77
+ ## [3.1.0] - 2014-12-21
78
+ ### Added
79
+ - Note in README.md about production redis deployment configuration
80
+ - Better PID file cleanup
81
+ - Option to filter by job class in `Resque.remove_delayed_selection`
82
+ - Tell-don't-ask with `Resque.schedule` to enable atomic clear & set
83
+
84
+ ### Changed
85
+ - Avoid use of redis `KEYS` command in `Resque.remove_delayed_selection`
86
+
87
+ ### Fixed
88
+ - Only release master lock if it belongs to us
89
+ - Only override configuration options if provided
90
+
91
+ ## [3.0.0] - 2014-05-27
92
+ ### Added
93
+ - Vagrant setup
94
+ - Support for last execution information through the web
95
+ - CodeClimate integration
96
+ - `Resque.delayed?` and `Resque.next_delayed_schedule`
97
+ - Allow scheduled jobs to be deleted via resque web
98
+
99
+ ### Changed
100
+ - The grand re-namespacing of `resque_scheduler/(.*)` =>
101
+ `resque/scheduler/\1`
102
+ - "Refactoring"
103
+ - Cleanup of a ton of rubocop offenses
104
+ - Documentation updates
105
+ - Handling signals while "sleeping" by relying on `Thread#wakeup`
106
+ - Testing against same rubies as resque (+ 2.1.1)
107
+ - Renamed `Resque.set_last_run` to `Resque.last_enqueued_at`
108
+
109
+ ### Fixed
110
+ - Duplicated layout for `search_form` partial template.
111
+ - Issue where Web UI was ONLY showing jobs that only run in the current
112
+ environment
113
+
114
+ ## [2.5.5] - 2014-02-27
115
+ ### Changed
116
+ - Only showing link to job with args if job is present
117
+ - Only showing scheduled jobs that match current env or omit env
118
+ - Ensuring lock and acquire lua scripts are refreshed on timeout change
119
+ - Switch to using `mono_logger` instead of stdlib `logger`
120
+
121
+ ## [2.5.4] - 2014-02-17
122
+ ### Changed
123
+ - Documentation updates
124
+
125
+ ## [2.5.3] - 2014-02-12
126
+ ### Fixed
127
+ - Handling signals during poll sleep
128
+
129
+ ## [2.5.2] - 2014-02-11
130
+ ### Changed
131
+ - Pinning down dependency versions more tightly
132
+
133
+ ## [2.5.1] - 2014-02-09
134
+ ### Fixed
135
+ - Make signal handling (really) Ruby 2 compatible
136
+
137
+ ## [2.5.0] - 2014-02-09
138
+ ### Added
139
+ - Search feature to the Delayed tab in Resque Web
140
+
141
+ ### Changed
142
+ - Use `logger.error` when logging errors from `handle_errors`
143
+
144
+ ### Fixed
145
+ - Confusion with redis version requirements in `README.md`
146
+
147
+ ## [2.4.0] - 2014-01-14
148
+ ### Added
149
+ - Including optional env and app names in procline
150
+ - A standalone `resque-scheduler` executable
151
+ - Support for persistence of dynamic schedules
152
+ - `.configure` convenience method for block-style configuration
153
+ - `.remove_delayed_selection` method to remove based on result of a block
154
+ - Support for viewing all schedules for a job in web UI
155
+
156
+ ### Changed
157
+ - Bumping the copyright year
158
+ - Corrected doc for syntax of class and every keys
159
+ - Use resque redis namespace in the master lock key
160
+ - Various test improvements, :bug: fixes, and documentation updates!
161
+
162
+ ### Removed
163
+ - **POSSIBLE BREAKING CHANGE**: Dropping support for ree
164
+
165
+ ### Fixed
166
+ - An explosion regarding `every` in the views
167
+ - Unsafe shutdown in Ruby 2
168
+
169
+ ## 2.3.1 (2013-11-20)
170
+ ### Fixed
171
+ - `require_paths` in gemspec
172
+
173
+ ## 2.3.0 (2013-11-07)
174
+ ### Added
175
+ - Add rufus scheduler `every` notice to README
176
+ - Specify MIT license in gemspec
177
+
178
+ ### Changed
179
+ - **BREAKING CHANGE**: Added `RESQUE_SCHEDULER_INTERVAL` in place of `INTERVAL`
180
+ - Use `Float()` instead of `Integer()` to calculate poll sleep amount
181
+ - Upgraded dependence of Resque to support 1.25
182
+ - Use `Resque.validate` instead of custom `.validate_job!`
183
+
184
+ ### Fixed
185
+ - Re-introduced `ThreadError` on Ruby 2
186
+
187
+ ## 2.2.0 (2013-10-13)
188
+ ### Added
189
+ - Support for parameterized resque jobs.
190
+ - Allowing prefix for `master_lock_key`.
191
+ - `Resque.clean_schedules` method, which is useful when setting up the scheduler
192
+ for the first time.
193
+
194
+ ### Changed
195
+ - Locking rufus-scheduler dependency to `~> 2.0`
196
+ - Updated redis dependency to `>= 3.0.0`
197
+
198
+ ### Fixed
199
+ - Bug fixes related to first time schedule retrieval and missing schedules.
200
+
201
+ ## 2.1.0 (2013-09-20)
202
+ ### Added
203
+ - Add `#scheduled_at` which returns an array of timestamps at which the
204
+ specified job is scheduled
205
+ - Add `#enqueue_delayed` for enqueueing specific delayed jobs immediately
206
+ - Show server local time in resque-web
207
+ - Add support for configuring `Resque::Scheduler.poll_sleep_amount` via the
208
+ `INTERVAL` environmental variable.
209
+
210
+ ### Changed
211
+ - Locking to resque < 1.25.0 (for now)
212
+ - Syncing stdout/stderr
213
+ - Using a logger instead of `#puts`, configurable via `LOGFILE`, `VERBOSE`, and
214
+ `MUTE` environmental variables, as well as being settable via
215
+ `Resque::Scheduler#logger`
216
+ - Enqueue immediately if job is being enqueued in the past
217
+
218
+ ### Removed
219
+ - Dependency on `Resque::Helpers`
220
+
221
+ ### Fixed
222
+ - Ensuring `Resque.schedule=` sets rather than appends
223
+ - Process daemonization fixes including stdio redirection and redis client
224
+ reconnection
225
+ - Scheduler template when arrays are passed to rufus-scheduler
226
+ - Fixed shutdown in ruby 2.0.0
227
+
228
+ ## [2.0.1] - 2013-03-20
229
+ ### Added
230
+ - Locking to support master failover
231
+ - Allow custom job classes to be used in `Resque.enqueue_at`
232
+ - Allowing `#enqueue_at` to call `#scheduled` when `Resque.inline` is `true`
233
+
234
+ ### Changed
235
+ - More efficient `#remove_delayed` implementation
236
+
237
+ ## [2.0.0] - 2012-05-04
238
+ ### Added
239
+ - Support for Resque.inline configuration (carlosantoniodasilva)
240
+
241
+ ### Fixed
242
+ - Possible job loss race condition around deleting delayed queues and enqueuing
243
+ a job 0 seconds in the future.
244
+
245
+ ## [2.0.0.h] - 2012-03-19
246
+ ### Added
247
+ - Plugin support with hooks (andreas)
248
+
249
+ ## [2.0.0.f] - 2011-11-03
250
+ ### Added
251
+ - Support `ENV['BACKGROUND']` flag for daemonizing (bernerdschaefer)
252
+ - Added support for `before_schedule` and `after_schedule` hooks (yaauie)
253
+ - Added `remove_delayed_job_from_timestamp` to remove delayed jobs from
254
+ a given timestamp.
255
+
256
+ ### Fixed
257
+ - Address race condition with delayed jobs (using redis transactions)
258
+
259
+ ## [2.0.0.e] - 2011-09-16
260
+ ### Added
261
+ - `enqueue_at_with_queue`/`enqueue_in_with_queue` support (niralisse)
262
+ - `Resque::Scheduler.poll_sleep_amount` to allow for configuring
263
+ the sleep time b/w delayed queue polls.
264
+ - "Clear Delayed Jobs" button to the Delayed Jobs page (john-griffin)
265
+
266
+ ### Fixed
267
+ - Pagination issue on the Delayed tab
268
+
269
+ ## [2.0.0.d] - 2011-04-04
270
+ ### Changed
271
+ - Porting bug fixes from v1.9-stable
272
+
273
+ ## [2.0.0.c] - 2011-03-25
274
+ ### Changed
275
+ - Rake task drop a pid file (sreeix)
276
+
277
+ ## [2.0.0.b] - 2011-02-25
278
+ ### Fixed
279
+ - Bugs
280
+
281
+ ## 2.0.0.a - 2010-12-10
282
+ ### Added
283
+ - Dynamic schedule support (brianjlandau, davidyang)
284
+
285
+ ### Changed
286
+ - Now depends on redis >=1.3
287
+
288
+ ## [1.9.11] - 2013-11-20
289
+ ### Fixed
290
+ - Behavior of `#validate_job!` via `#enqueue_at_with_queue` #286
291
+ - `require_paths` in gemspec #288
292
+
293
+ ## [1.9.10] - 2013-09-19
294
+ ### Added
295
+ - Backported `#enqueue_at_with_queue`
296
+ - Locking to resque < 1.25.0
297
+ - Ruby 1.8 compatibility in scheduler tab when schedule keys are symbols
298
+
299
+ ### Changed
300
+ - Mocha setup compatibility
301
+
302
+ ## [1.9.9] - 2011-03-29
303
+ ### Added
304
+ - Compatibility with resque 1.15.0
305
+
306
+ ## [1.9.8] - 2011-01-14
307
+ ### Changed
308
+ - Validates delayed jobs prior to insertion into the delayed queue (bogdan)
309
+ - Rescue exceptions that occur during queuing and log them (dgrijalva)
310
+
311
+ ## [1.9.7] - 2010-11-09
312
+ ### Added
313
+ - Support for rufus-scheduler "every" syntax (fallwith)
314
+ - Ability to pass a Time to `handle_delayed_items` for testing/staging (rcarver)
315
+
316
+ ## [1.9.6] - 2010-10-08
317
+ ### Added
318
+ - Support for custom job classes (like resque-status) (mattetti)
319
+
320
+ ## [1.9.5] - 2010-09-09
321
+ ### Changed
322
+ - Updated scheduler rake task to allow for an alternate setup task
323
+ to avoid loading the entire stack. (chewbranca)
324
+
325
+ ### Fixed
326
+ - Sig issue on win32 (#25)
327
+
328
+ ## [1.9.4] - 2010-07-29
329
+ ### Added
330
+ - Ability to remove jobs from delayed queue (joshsz)
331
+
332
+ ### Fixed
333
+ - Issue #23 (removing .present? reference)
334
+
335
+ ## [1.9.3] - 2010-07-07
336
+ ### Fixed
337
+ - Bug fix (#19)
338
+
339
+ ## [1.9.2] - 2010-06-16
340
+ ### Fixed
341
+ - Issue with redis gem 2.0.1 and redis server 1.2.6 (dbackeus)
342
+
343
+ ## [1.9.1] - 2010-06-04
344
+ ### Fixed
345
+ - Issue with redis server 1.2.6 and redis gem 2.0.1
346
+
347
+ ## [1.9.0] - 2010-06-04
348
+ ### Added
349
+ - Redis 2.0 support (bpo)
350
+
351
+ ## [1.8.2] - 2010-06-04
352
+ ### Added
353
+ - Queue now functionality to delayed timestamps (daviddoan)
354
+
355
+ ## [1.8.1] - 2010-05-19
356
+ ### Added
357
+ - `rails_env` for scheduled jobs to support scoping jobs by
358
+ `RAILS_ENV` (gravis).
359
+ - Adding gemspec for bundler support.
360
+
361
+ ### Fixed
362
+ - Ruby 1.8.6 compatibility issue.
363
+
364
+ ## [1.8.0] - 2010-04-14
365
+ ### Added
366
+ - Tests for resque-web (gravis)
367
+
368
+ ### Changed
369
+ - Moving version to match corresponding resque version
370
+ - Sorting schedule on Scheduler tab
371
+
372
+ ## [1.0.5] - 2010-03-01
373
+ ### Fixed
374
+ - Support for overriding queue from schedule config.
375
+
376
+ ### Changed
377
+ - The queue is now stored with the job and arguments in the delayed queue so
378
+ there is no longer a need for the scheduler to load job classes to introspect
379
+ the queue.
380
+
381
+ ### Removed
382
+ - resque-web dependency on loading the job classes for "Queue Now", provided
383
+ "queue" is specified in the schedule.
384
+
385
+ ## [1.0.4] - 2010-02-26
386
+ ### Added
387
+ - Support for specifying the queue to put the job onto. This allows for you to
388
+ have one job that can go onto multiple queues and be able to schedule jobs
389
+ without having to load the job classes.
390
+
391
+ ## [1.0.3] - 2010-02-11
392
+ ### Added
393
+ - Support for scheduled jobs with empty crons. This is helpful to have jobs that
394
+ you don't want on a schedule, but do want to be able to queue by clicking a
395
+ button.
396
+
397
+ ## [1.0.2] - 2010-02-10
398
+ ### Changed
399
+ - Delayed Job tab to display job details if only 1 job exists for a given
400
+ timestamp
401
+
402
+ ## [1.0.1] - 2010-02-01
403
+ ### Fixed
404
+ - Delayed jobs close together resulted in a 5 second sleep
405
+
406
+ ## [1.0.0] - 2009-12-21
407
+ ### Added
408
+ - Initial release
409
+
410
+ [Unreleased]: https://github.com/resque/resque-scheduler/compare/v4.3.0...HEAD
411
+ [4.3.0]: https://github.com/resque/resque-scheduler/compare/v4.2.1...v4.3.0
412
+ [4.2.1]: https://github.com/resque/resque-scheduler/compare/v4.2.0...v4.2.1
413
+ [4.2.0]: https://github.com/resque/resque-scheduler/compare/v4.1.0...v4.2.0
414
+ [4.1.0]: https://github.com/resque/resque-scheduler/compare/v4.0.0...v4.1.0
415
+ [4.0.0]: https://github.com/resque/resque-scheduler/compare/v3.1.0...v4.0.0
416
+ [3.1.0]: https://github.com/resque/resque-scheduler/compare/v3.0.0...v3.1.0
417
+ [3.0.0]: https://github.com/resque/resque-scheduler/compare/v2.5.5...v3.0.0
418
+ [2.5.5]: https://github.com/resque/resque-scheduler/compare/v2.5.4...v2.5.5
419
+ [2.5.4]: https://github.com/resque/resque-scheduler/compare/v2.5.3...v2.5.4
420
+ [2.5.3]: https://github.com/resque/resque-scheduler/compare/v2.5.2...v2.5.3
421
+ [2.5.2]: https://github.com/resque/resque-scheduler/compare/v2.5.1...v2.5.2
422
+ [2.5.1]: https://github.com/resque/resque-scheduler/compare/v2.5.0...v2.5.1
423
+ [2.5.0]: https://github.com/resque/resque-scheduler/compare/v2.4.0...v2.5.0
424
+ [2.4.0]: https://github.com/resque/resque-scheduler/compare/v2.3.1...v2.4.0
425
+ [2.3.1]: https://github.com/resque/resque-scheduler/compare/v2.3.0...v2.3.1
426
+ [2.3.0]: https://github.com/resque/resque-scheduler/compare/v2.2.0...v2.3.0
427
+ [2.2.0]: https://github.com/resque/resque-scheduler/compare/v2.1.0...v2.2.0
428
+ [2.1.0]: https://github.com/resque/resque-scheduler/compare/v2.0.1...v2.1.0
429
+ [2.0.1]: https://github.com/resque/resque-scheduler/compare/v2.0.0...v2.0.1
430
+ [2.0.0]: https://github.com/resque/resque-scheduler/compare/v2.0.0.h...v2.0.0
431
+ [2.0.0.h]: https://github.com/resque/resque-scheduler/compare/v2.0.0.f...v2.0.0.h
432
+ [2.0.0.f]: https://github.com/resque/resque-scheduler/compare/v2.0.0.e...v2.0.0.f
433
+ [2.0.0.e]: https://github.com/resque/resque-scheduler/compare/v2.0.0.d...v2.0.0.e
434
+ [2.0.0.d]: https://github.com/resque/resque-scheduler/compare/v2.0.0.c...v2.0.0.d
435
+ [2.0.0.c]: https://github.com/resque/resque-scheduler/compare/61c7b5f...v2.0.0.c
436
+ [2.0.0.b]: https://github.com/resque/resque-scheduler/compare/v2.0.0.a...61c7b5f
437
+ [1.9.11]: https://github.com/resque/resque-scheduler/compare/v1.9.10...v1.9.11
438
+ [1.9.10]: https://github.com/resque/resque-scheduler/compare/v1.9.9...v1.9.10
439
+ [1.9.9]: https://github.com/resque/resque-scheduler/compare/v1.9.8...v1.9.9
440
+ [1.9.8]: https://github.com/resque/resque-scheduler/compare/v1.9.7...v1.9.8
441
+ [1.9.7]: https://github.com/resque/resque-scheduler/compare/v1.9.6...v1.9.7
442
+ [1.9.6]: https://github.com/resque/resque-scheduler/compare/v1.9.5...v1.9.6
443
+ [1.9.5]: https://github.com/resque/resque-scheduler/compare/v1.9.4...v1.9.5
444
+ [1.9.4]: https://github.com/resque/resque-scheduler/compare/v1.9.3...v1.9.4
445
+ [1.9.3]: https://github.com/resque/resque-scheduler/compare/v1.9.2...v1.9.3
446
+ [1.9.2]: https://github.com/resque/resque-scheduler/compare/v1.9.1...v1.9.2
447
+ [1.9.1]: https://github.com/resque/resque-scheduler/compare/v1.9.0...v1.9.1
448
+ [1.9.0]: https://github.com/resque/resque-scheduler/compare/v1.8.2...v1.9.0
449
+ [1.8.2]: https://github.com/resque/resque-scheduler/compare/v1.8.1...v1.8.2
450
+ [1.8.1]: https://github.com/resque/resque-scheduler/compare/v1.8.0...v1.8.1
451
+ [1.8.0]: https://github.com/resque/resque-scheduler/compare/v1.0.5...v1.8.0
452
+ [1.0.5]: https://github.com/resque/resque-scheduler/compare/v1.0.4...v1.0.5
453
+ [1.0.4]: https://github.com/resque/resque-scheduler/compare/v1.0.3...v1.0.4
454
+ [1.0.3]: https://github.com/resque/resque-scheduler/compare/v1.0.2...v1.0.3
455
+ [1.0.2]: https://github.com/resque/resque-scheduler/compare/v1.0.1...v1.0.2
456
+ [1.0.1]: https://github.com/resque/resque-scheduler/compare/v1.0.0...v1.0.1
457
+ [1.0.0]: https://github.com/resque/resque-scheduler/compare/v0.0.1...v1.0.0
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  resque-scheduler
2
2
  ================
3
3
 
4
+
4
5
  [![Dependency Status](https://gemnasium.com/badges/github.com/resque/resque-scheduler.svg)](https://gemnasium.com/github.com/resque/resque-scheduler)
5
6
  [![Gem Version](https://badge.fury.io/rb/resque-scheduler.svg)](https://badge.fury.io/rb/resque-scheduler)
6
7
  [![Build Status](https://travis-ci.org/resque/resque-scheduler.svg?branch=master)](https://travis-ci.org/resque/resque-scheduler)
@@ -290,6 +291,19 @@ clear_leaderboards_contributors:
290
291
  description: "This job resets the weekly leaderboard for contributions"
291
292
  ```
292
293
 
294
+ If you would like to setup a job that is executed manually you can configure like this in your YAML file.
295
+
296
+ ```yaml
297
+ ImportOrdersManual:
298
+ description: 'Import Amazon Orders Manual'
299
+ custom_job_class: 'AmazonMws::ImportOrdersJob'
300
+ never: "* * * * *"
301
+ queue: high
302
+ description: "This is a manual job for importing orders."
303
+ args:
304
+ days_in_arrears: 7
305
+ ```
306
+
293
307
  The queue value is optional, but if left unspecified resque-scheduler will
294
308
  attempt to get the queue from the job class, which means it needs to be
295
309
  defined. If you're getting "uninitialized constant" errors, you probably
@@ -141,11 +141,7 @@ module Resque
141
141
  args = [args, nil, job: true] if args.is_a?(::String)
142
142
 
143
143
  job = rufus_scheduler.send(interval_type, *args) do
144
- if master?
145
- log! "queueing #{config['class']} (#{name})"
146
- Resque.last_enqueued_at(name, Time.now.to_s)
147
- enqueue(config)
148
- end
144
+ enqueue_recurring(name, config)
149
145
  end
150
146
  @scheduled_jobs[name] = job
151
147
  interval_defined = true
@@ -371,7 +367,13 @@ module Resque
371
367
  true
372
368
  end
373
369
 
370
+ def stop_rufus_scheduler
371
+ rufus_scheduler.shutdown(:wait)
372
+ rufus_scheduler.join
373
+ end
374
+
374
375
  def before_shutdown
376
+ stop_rufus_scheduler
375
377
  release_master_lock
376
378
  end
377
379
 
@@ -417,6 +419,14 @@ module Resque
417
419
 
418
420
  private
419
421
 
422
+ def enqueue_recurring(name, config)
423
+ if master?
424
+ log! "queueing #{config['class']} (#{name})"
425
+ Resque.last_enqueued_at(name, Time.now.to_s)
426
+ enqueue(config)
427
+ end
428
+ end
429
+
420
430
  def app_str
421
431
  app_name ? "[#{app_name}]" : ''
422
432
  end
@@ -128,6 +128,7 @@ module Resque
128
128
  def option_parser
129
129
  OptionParser.new do |opts|
130
130
  opts.banner = BANNER
131
+ opts.version = Resque::Scheduler::VERSION
131
132
  OPTIONS.each do |opt|
132
133
  opts.on(*opt[:args], &opt[:callback].call(options))
133
134
  end
@@ -6,19 +6,11 @@ module Resque
6
6
  module Lock
7
7
  class Resilient < Base
8
8
  def acquire!
9
- Resque.redis.evalsha(
10
- acquire_sha,
11
- keys: [key],
12
- argv: [value]
13
- ).to_i == 1
9
+ evalsha(:acquire, [key], [value]).to_i == 1
14
10
  end
15
11
 
16
12
  def locked?
17
- Resque.redis.evalsha(
18
- locked_sha,
19
- keys: [key],
20
- argv: [value]
21
- ).to_i == 1
13
+ evalsha(:locked, [key], [value]).to_i == 1
22
14
  end
23
15
 
24
16
  def timeout=(seconds)
@@ -32,6 +24,21 @@ module Resque
32
24
 
33
25
  private
34
26
 
27
+ def evalsha(script, keys, argv, refresh: false)
28
+ sha_method_name = "#{script}_sha"
29
+ Resque.redis.evalsha(
30
+ send(sha_method_name, refresh),
31
+ keys: keys,
32
+ argv: argv
33
+ )
34
+ rescue Redis::CommandError => e
35
+ if e.message =~ /NOSCRIPT/
36
+ refresh = true
37
+ retry
38
+ end
39
+ raise
40
+ end
41
+
35
42
  def locked_sha(refresh = false)
36
43
  @locked_sha = nil if refresh
37
44
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Resque
4
4
  module Scheduler
5
- VERSION = '4.3.0'.freeze
5
+ VERSION = '4.3.1'.freeze
6
6
  end
7
7
  end
@@ -47,13 +47,14 @@ Gem::Specification.new do |spec|
47
47
  spec.add_development_dependency 'simplecov'
48
48
  spec.add_development_dependency 'test-unit'
49
49
  spec.add_development_dependency 'yard'
50
+ spec.add_development_dependency 'tzinfo-data'
50
51
 
51
52
  # We pin rubocop because new cops have a tendency to result in false-y
52
53
  # positives for new contributors, which is not a nice experience.
53
54
  spec.add_development_dependency 'rubocop', '~> 0.40.0'
54
55
 
55
56
  spec.add_runtime_dependency 'mono_logger', '~> 1.0'
56
- spec.add_runtime_dependency 'redis', '~> 3.3'
57
+ spec.add_runtime_dependency 'redis', '>= 3.3', '< 5'
57
58
  spec.add_runtime_dependency 'resque', '~> 1.26'
58
59
  spec.add_runtime_dependency 'rufus-scheduler', '~> 3.2'
59
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben VandenBos
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2016-06-26 00:00:00.000000000 Z
14
+ date: 2017-11-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -167,6 +167,20 @@ dependencies:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
+ - !ruby/object:Gem::Dependency
171
+ name: tzinfo-data
172
+ requirement: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ type: :development
178
+ prerelease: false
179
+ version_requirements: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
170
184
  - !ruby/object:Gem::Dependency
171
185
  name: rubocop
172
186
  requirement: !ruby/object:Gem::Requirement
@@ -199,16 +213,22 @@ dependencies:
199
213
  name: redis
200
214
  requirement: !ruby/object:Gem::Requirement
201
215
  requirements:
202
- - - "~>"
216
+ - - ">="
203
217
  - !ruby/object:Gem::Version
204
218
  version: '3.3'
219
+ - - "<"
220
+ - !ruby/object:Gem::Version
221
+ version: '5'
205
222
  type: :runtime
206
223
  prerelease: false
207
224
  version_requirements: !ruby/object:Gem::Requirement
208
225
  requirements:
209
- - - "~>"
226
+ - - ">="
210
227
  - !ruby/object:Gem::Version
211
228
  version: '3.3'
229
+ - - "<"
230
+ - !ruby/object:Gem::Version
231
+ version: '5'
212
232
  - !ruby/object:Gem::Dependency
213
233
  name: resque
214
234
  requirement: !ruby/object:Gem::Requirement
@@ -252,10 +272,10 @@ extensions: []
252
272
  extra_rdoc_files: []
253
273
  files:
254
274
  - AUTHORS.md
275
+ - CHANGELOG.md
255
276
  - CODE_OF_CONDUCT.md
256
277
  - CONTRIBUTING.md
257
278
  - Gemfile
258
- - HISTORY.md
259
279
  - LICENSE
260
280
  - README.md
261
281
  - Rakefile
@@ -309,9 +329,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
309
329
  version: '0'
310
330
  requirements: []
311
331
  rubyforge_project:
312
- rubygems_version: 2.5.1
332
+ rubygems_version: 2.6.8
313
333
  signing_key:
314
334
  specification_version: 4
315
335
  summary: Light weight job scheduling on top of Resque
316
336
  test_files: []
317
- has_rdoc:
data/HISTORY.md DELETED
@@ -1,310 +0,0 @@
1
- # Resque Scheduler History / ChangeLog / Release Notes
2
-
3
- ## 4.3.0 (2016-06-26)
4
- * Add Windows testing on Appveyor
5
- * Silence output by default when daemonizing
6
- * Update vagrant setup
7
- * Add a Code of Conduct
8
- * Update gem metadata per latest Bundler defaults
9
-
10
- ## 4.2.1 (2016-06-08)
11
- * Optimization of `find_delayed_selection`
12
- * More defensive code around redis disconnects
13
- * Only trap existing signals on given platform
14
- * RuboCop auto-fixes
15
- * Dependency updates
16
- * Docs improvements
17
-
18
- ## 4.2.0 (2016-04-29)
19
- * Bugfix for a race condition in concurrent restarts
20
- * Clean up and simplify the scheduling extension
21
- * Make `Resque::Scheduler.logger` accessible to user
22
- * Failure hook support for better extensibility
23
- * Default failure handler now outputs stacktrace
24
- * Add index column to scheduler tab
25
- * Update rufus-scheduler
26
- * Bugfix for displaying schedules appropriate to the `env`
27
- in scheduler UI
28
-
29
- ## 4.1.0 (2016-02-10)
30
- * View helper to cut down on repetition
31
- * Bugfix to check thread life only if present
32
- * New `Resque.(find|enqueue)_delayed_selection` methods to complement
33
- `Resque.remove_delayed_selection`
34
- * Leave undefined env vars unset in internal options hash
35
- * Insulate checking `Rails.env`
36
- * Documentation updates and typo fixes
37
-
38
- ## 4.0.0 (2014-12-21)
39
- * Bump rufus-scheduler dependency to `~> 3.0`
40
- * Address warning from redis-namespace related to `#unwatch`
41
- * Show current master in the web UI
42
- * Bugfix related to schedule check when no jobs are in the queue
43
- * Documentation updates
44
-
45
- ## 3.1.0 (2014-12-21)
46
- * Note in README.md about production redis deployment configuration
47
- * Bugfix to only override configuration options if provided
48
- * Avoid use of redis `KEYS` command in `Resque.remove_delayed_selection`
49
- * Better PID file cleanup
50
- * Added option to filter by job class in `Resque.remove_delayed_selection`
51
- * Bugfix to only release master lock if it belongs to us
52
- * Tell-don't-ask with `Resque.schedule` to enable atomic clear & set
53
-
54
- ## 3.0.0 (2014-05-27)
55
- * The grand re-namespacing of
56
- `resque_scheduler/(.*)` =&gt; `resque/scheduler/\1`
57
- * Cleanup of a ton of rubocop offenses
58
- * Vagrant setup
59
- * Documentation updates
60
- * "Refactoring"
61
- * Added support for last execution information through the web
62
- * Handling signals while "sleeping" by relying on `Thread#wakeup`
63
- * CodeClimate integration
64
- * Addition of `Resque.delayed?` and `Resque.next_delayed_schedule`
65
- * Testing against same rubies as resque (+ 2.1.1)
66
- * Renamed `Resque.set_last_run` to `Resque.last_enqueued_at`
67
- * Allow scheduled jobs to be deleted via resque web
68
- * Fixed duplicated layout for `search_form` partial template.
69
- * Fix issue where Web UI was ONLY showing jobs that only run in the current
70
- environment
71
-
72
- ## 2.5.5 (2014-02-27)
73
- * Only showing link to job with args if job is present
74
- * Only showing scheduled jobs that match current env or omit env
75
- * Ensuring lock and acquire lua scripts are refreshed on timeout change
76
- * Switch to using `mono_logger` instead of stdlib `logger`
77
-
78
- ## 2.5.4 (2014-02-17)
79
- * Documentation updates
80
-
81
- ## 2.5.3 (2014-02-12)
82
- * Handling signals during poll sleep
83
-
84
- ## 2.5.2 (2014-02-11)
85
- * Pinning down dependency versions more tightly
86
-
87
- ## 2.5.1 (2014-02-09)
88
- * Make signal handling (really) Ruby 2 compatible
89
-
90
- ## 2.5.0 (2014-02-09)
91
- * Use `logger.error` when logging errors from `handle_errors`
92
- * Added search feature to the Delayed tab in Resque Web
93
- * Fix confusion with redis version requirements in `README.md`
94
-
95
- ## 2.4.0 (2014-01-14)
96
-
97
- * Including optional env name in procline
98
- * Fixing an explosion regarding `every` in the views
99
- * Bumping the copyright year
100
- * Corrected doc for syntax of class and every keys
101
- * Adding a standalone executable
102
- * **POSSIBLE BREAKING CHANGE**: Dropping support for ree
103
- * Add support for persistence of dynamic schedules
104
- * Fix unsafe shutdown in Ruby 2
105
- * Adding `.configure` convenience method for block-style configuration
106
- * Add `.remove_delayed_selection` method to remove based on result of a block
107
- * Add support for viewing all schedules for a job in web UI
108
- * Use resque redis namespace in the master lock key
109
- * Including optional app name in procline
110
- * Various test improvements, :bug: fixes, and documentation updates!
111
-
112
- ## 2.3.1 (2013-11-20)
113
-
114
- * Correcting `require_paths` in gemspec
115
-
116
- ## 2.3.0 (2013-11-07)
117
-
118
- * Fix re-introduced `ThreadError` on Ruby 2
119
- * **BREAKING CHANGE**: Added `RESQUE_SCHEDULER_INTERVAL` in place of `INTERVAL`
120
- * Use `Float()` instead of `Integer()` to calculate poll sleep amount
121
- * Upgraded dependence of Resque to support 1.25
122
- * Add rufus scheduler `every` notice to README
123
- * Use `Resque.validate` instead of custom `.validate_job!`
124
- * Specify MIT license in gemspec
125
-
126
- ## 2.2.0 (2013-10-13)
127
-
128
- * Locking rufus-scheduler dependency to `~> 2.0`
129
- * Updated redis dependency to `>= 3.0.0`
130
- * Add support for parameterized resque jobs.
131
- * Allowing prefix for `master_lock_key`.
132
- * Add `Resque.clean_schedules` method, which is useful when setting up the
133
- scheduler for the first time.
134
- * Bug fixes related to first time schedule retrieval and missing schedules.
135
-
136
- ## 2.1.0 (2013-09-20)
137
-
138
- * Locking to resque &lt; 1.25.0 (for now)
139
- * Ensuring `Resque.schedule=` sets rather than appends
140
- * Process daemonization fixes including stdio redirection and redis client
141
- reconnection
142
- * Add `#scheduled_at` which returns an array of timestamps at which the
143
- specified job is scheduled
144
- * Syncing stdout/stderr
145
- * Add `#enqueue_delayed` for enqueueing specific delayed jobs immediately
146
- * Show server local time in resque-web
147
- * Enqueue immediately if job is being enqueued in the past
148
- * Using a logger instead of `#puts`, configurable via `LOGFILE`, `VERBOSE`, and
149
- `MUTE` environmental variables, as well as being settable via
150
- `Resque::Scheduler#logger`
151
- * Fixing scheduler template when arrays are passed to rufus-scheduler
152
- * Add support for configuring `Resque::Scheduler.poll_sleep_amount` via the
153
- `INTERVAL` environmental variable.
154
- * Fixed shutdown in ruby 2.0.0
155
- * Removed dependency on `Resque::Helpers`
156
-
157
- ## 2.0.1 (2013-03-20)
158
-
159
- * Adding locking to support master failover
160
- * Allow custom job classes to be used in `Resque.enqueue_at`
161
- * More efficient `#remove_delayed` implementation
162
- * Allowing `#enqueue_at` to call `#scheduled` when `Resque.inline` is `true`
163
-
164
- ## 2.0.0 (2012-05-04)
165
-
166
- * Add support for Resque.inline configuration (carlosantoniodasilva)
167
- * Fixing possible job loss race condition around deleting delayed queues
168
- and enqueuing a job 0 seconds in the future.
169
-
170
- ### 2.0.0.h (2012-03-19)
171
-
172
- * Adding plugin support with hooks (andreas)
173
-
174
- ### 2.0.0.f (2011-11-03)
175
-
176
- * TODO: address race condition with delayed jobs (using redis transactions)
177
- * Support `ENV['BACKGROUND']` flag for daemonizing (bernerdschaefer)
178
- * Added support for `before_schedule` and `after_schedule` hooks (yaauie)
179
- * Added `remove_delayed_job_from_timestamp` to remove delayed jobs from
180
- a given timestamp.
181
-
182
- ### 2.0.0.e (2011-09-16)
183
-
184
- * Adding `enqueue_at_with_queue`/`enqueue_in_with_queue` support (niralisse)
185
- * Adding `Resque::Scheduler.poll_sleep_amount` to allow for configuring
186
- the sleep time b/w delayed queue polls.
187
- * Add a "Clear Delayed Jobs" button to the Delayed Jobs page (john-griffin)
188
- * Fixed pagination issue on the Delayed tab
189
-
190
- ### 2.0.0.d (2011-04-04)
191
-
192
- * porting bug fixes from v1.9-stable
193
-
194
- ### 2.0.0.c
195
-
196
- * Rake task drop a pid file (sreeix)
197
-
198
- ### 2.0.0.b
199
-
200
- * Bug fixes
201
-
202
- ### 2.0.0.a
203
-
204
- * Dynamic schedule support (brianjlandau, davidyang)
205
- * Now depends on redis >=1.3
206
-
207
- ## 1.9.11 (2013-11-20)
208
-
209
- * Fixed behavior of `#validate_job!` via `#enqueue_at_with_queue` #286
210
- * Correcting `require_paths` in gemspec #288
211
-
212
- ## 1.9.10 (2013-09-19)
213
-
214
- * Backported `#enqueue_at_with_queue`
215
- * Locking to resque &lt; 1.25.0
216
- * Mocha setup compatibility
217
- * Ruby 1.8 compatibility in scheduler tab when schedule keys are symbols
218
-
219
- ## 1.9.9 (2011-03-29)
220
-
221
- * Compatibility with resque 1.15.0
222
-
223
- ## 1.9.8 (???)
224
-
225
- * Validates delayed jobs prior to insertion into the delayed queue (bogdan)
226
- * Rescue exceptions that occur during queuing and log them (dgrijalva)
227
-
228
- ## 1.9.7 (2010-11-09)
229
-
230
- * Support for rufus-scheduler "every" syntax (fallwith)
231
- * Ability to pass a Time to `handle_delayed_items` for testing/staging (rcarver)
232
-
233
- ## 1.9.6 (2010-10-08)
234
-
235
- * Support for custom job classes (like resque-status) (mattetti)
236
-
237
- ## 1.9.5 (2010-09-09)
238
-
239
- * Updated scheduler rake task to allow for an alternate setup task
240
- to avoid loading the entire stack. (chewbranca)
241
- * Fixed sig issue on win32 (#25)
242
-
243
- ## 1.9.4 (2010-07-29)
244
-
245
- * Adding ability to remove jobs from delayed queue (joshsz)
246
- * Fixing issue #23 (removing .present? reference)
247
-
248
- ## 1.9.3 (2010-07-07)
249
-
250
- * Bug fix (#19)
251
-
252
- ## 1.9.2 (2010-06-16)
253
-
254
- * Fixing issue with redis gem 2.0.1 and redis server 1.2.6 (dbackeus)
255
-
256
- ## 1.9.1 (2010-06-04)
257
-
258
- * Fixing issue with redis server 1.2.6 and redis gem 2.0.1
259
-
260
- ## 1.9.0 (2010-06-04)
261
-
262
- * Adding redis 2.0 support (bpo)
263
-
264
- ## 1.8.2 (2010-06-04)
265
-
266
- * Adding queue now functionality to delayed timestamps (daviddoan)
267
-
268
- ## 1.8.1 (2010-05-19)
269
-
270
- * Adding `rails_env` for scheduled jobs to support scoping jobs by
271
- `RAILS_ENV` (gravis).
272
- * Fixing ruby 1.8.6 compatibility issue.
273
- * Adding gemspec for bundler support.
274
-
275
- ## 1.8.0 (2010-04-14)
276
-
277
- * Moving version to match corresponding resque version
278
- * Sorting schedule on Scheduler tab
279
- * Adding tests for resque-web (gravis)
280
-
281
- ## 1.0.5 (2010-03-01)
282
-
283
- * Fixed support for overriding queue from schedule config.
284
- * Removed resque-web dependency on loading the job classes for "Queue Now",
285
- provided "queue" is specified in the schedule.
286
- * The queue is now stored with the job and arguments in the delayed queue so
287
- there is no longer a need for the scheduler to load job classes to introspect
288
- the queue.
289
-
290
- ## 1.0.4 (2010-02-26)
291
-
292
- * Added support for specifying the queue to put the job onto. This allows for
293
- you to have one job that can go onto multiple queues and be able to schedule
294
- jobs without having to load the job classes.
295
-
296
- ## 1.0.3 (2010-02-11)
297
-
298
- * Added support for scheduled jobs with empty crons. This is helpful to have
299
- jobs that you don't want on a schedule, but do want to be able to queue by
300
- clicking a button.
301
-
302
- ## 1.0.2 (2010-02-?)
303
-
304
- * Change Delayed Job tab to display job details if only 1 job exists
305
- for a given timestamp
306
-
307
- ## 1.0.1 (2010-01-?)
308
-
309
- * Bugfix: delayed jobs close together resulted in a 5 second sleep
310
-