resque-scheduler 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of resque-scheduler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/HISTORY.md +3 -0
- data/lib/resque/scheduler.rb +19 -11
- data/lib/resque_scheduler/version.rb +1 -1
- data/test/cli_test.rb +0 -17
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c05f1351c925cc303b776e6350b5930ae402f49e
|
4
|
+
data.tar.gz: 6bf4cb27cb0c669d39eb1b645f0cd6fad6f103fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb052b2a716d465e6e3726ca9e287b5b06a8d74f28a2f3bf9507aa6ab896816c0b64f02c013db6350b0c63f3f307434fe012e9837a0b142816bec23f0d517dc
|
7
|
+
data.tar.gz: 7bdd9f1bafceee0773e99c6bc22621d84d37a6bca2894250d33157c0d4a308e03c800c02445a713afd2b1f6a7312d0ec97460496639186ffb48b922219badb8e
|
data/.rubocop.yml
CHANGED
data/HISTORY.md
CHANGED
data/lib/resque/scheduler.rb
CHANGED
@@ -129,7 +129,6 @@ module Resque
|
|
129
129
|
log! e.message
|
130
130
|
end
|
131
131
|
end
|
132
|
-
handle_signals
|
133
132
|
poll_sleep
|
134
133
|
end
|
135
134
|
|
@@ -385,16 +384,7 @@ module Resque
|
|
385
384
|
def poll_sleep
|
386
385
|
handle_shutdown do
|
387
386
|
begin
|
388
|
-
|
389
|
-
@sleeping = true
|
390
|
-
sleep poll_sleep_amount
|
391
|
-
@sleeping = false
|
392
|
-
rescue Interrupt
|
393
|
-
if @shutdown
|
394
|
-
Resque.clean_schedules
|
395
|
-
release_master_lock!
|
396
|
-
end
|
397
|
-
end
|
387
|
+
poll_sleep_loop
|
398
388
|
ensure
|
399
389
|
@sleeping = false
|
400
390
|
end
|
@@ -402,6 +392,24 @@ module Resque
|
|
402
392
|
true
|
403
393
|
end
|
404
394
|
|
395
|
+
def poll_sleep_loop
|
396
|
+
@sleeping = true
|
397
|
+
start = Time.now
|
398
|
+
loop do
|
399
|
+
break if (Time.now - start) >= poll_sleep_amount
|
400
|
+
begin
|
401
|
+
sleep 0.01
|
402
|
+
handle_signals
|
403
|
+
rescue Interrupt
|
404
|
+
if @shutdown
|
405
|
+
Resque.clean_schedules
|
406
|
+
release_master_lock!
|
407
|
+
end
|
408
|
+
break
|
409
|
+
end
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
405
413
|
# Sets the shutdown flag, clean schedules and exits if sleeping
|
406
414
|
def shutdown
|
407
415
|
return if @shutdown
|
data/test/cli_test.rb
CHANGED
@@ -105,27 +105,10 @@ context 'Cli' do
|
|
105
105
|
cli.pre_run
|
106
106
|
end
|
107
107
|
|
108
|
-
test 'initializes dynamic from the env' do
|
109
|
-
cli = new_cli([], { 'DYNAMIC_SCHEDULE' => '1' })
|
110
|
-
assert_equal('flurb', cli.send(:options)[:dynamic])
|
111
|
-
end
|
112
|
-
|
113
108
|
test 'defaults to nil dynamic' do
|
114
109
|
assert_equal(nil, new_cli.send(:options)[:dynamic])
|
115
110
|
end
|
116
111
|
|
117
|
-
test 'accepts dynamic via -D' do
|
118
|
-
cli = new_cli(%w(-D))
|
119
|
-
cli.parse_options
|
120
|
-
assert_equal(true, cli.send(:options)[:dynamic])
|
121
|
-
end
|
122
|
-
|
123
|
-
test 'accepts dynamic via --dynamic-schedule' do
|
124
|
-
cli = new_cli(%w(--dynamic-schedule))
|
125
|
-
cli.parse_options
|
126
|
-
assert_equal(true, cli.send(:options)[:dynamic])
|
127
|
-
end
|
128
|
-
|
129
112
|
test 'initializes env from the env' do
|
130
113
|
cli = new_cli([], { 'RAILS_ENV' => 'flurb' })
|
131
114
|
assert_equal('flurb', cli.send(:options)[:env])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben VandenBos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
241
|
version: '0'
|
242
242
|
requirements: []
|
243
243
|
rubyforge_project:
|
244
|
-
rubygems_version: 2.0.
|
244
|
+
rubygems_version: 2.0.14
|
245
245
|
signing_key:
|
246
246
|
specification_version: 4
|
247
247
|
summary: Light weight job scheduling on top of Resque
|