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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ebe5197364fa17dcd71c7ba540ca2112e804c7c
4
- data.tar.gz: 976a33de3539e42972fff492ea2dae52fa673ea8
3
+ metadata.gz: c05f1351c925cc303b776e6350b5930ae402f49e
4
+ data.tar.gz: 6bf4cb27cb0c669d39eb1b645f0cd6fad6f103fd
5
5
  SHA512:
6
- metadata.gz: b499e49b8efba273c7449e137b5477d1f02624b84d18d195a5e0d58380394b392d82c62196ced80b020ca002aaf1463c6341b6702f672d4add8fba6ff0112006
7
- data.tar.gz: fdab96b1f7a58d5260bce7760a81e3dfaa5f087aebe5f3b57b55b6fb785a784b3f78cb5c431e03d8bdb027b63375eb85d6d435ddd8feffff40a2eea500977fd2
6
+ metadata.gz: 1cb052b2a716d465e6e3726ca9e287b5b06a8d74f28a2f3bf9507aa6ab896816c0b64f02c013db6350b0c63f3f307434fe012e9837a0b142816bec23f0d517dc
7
+ data.tar.gz: 7bdd9f1bafceee0773e99c6bc22621d84d37a6bca2894250d33157c0d4a308e03c800c02445a713afd2b1f6a7312d0ec97460496639186ffb48b922219badb8e
data/.rubocop.yml CHANGED
@@ -18,7 +18,7 @@ CaseEquality:
18
18
  Enabled: false
19
19
 
20
20
  ClassLength:
21
- Max: 318
21
+ Max: 325
22
22
 
23
23
  ClassVars:
24
24
  Enabled: false
data/HISTORY.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Resque Scheduler History / ChangeLog / Release Notes
2
2
 
3
+ ## 2.5.3 (2014-02-12)
4
+ * Handling signals during poll sleep
5
+
3
6
  ## 2.5.2 (2014-02-11)
4
7
  * Pinning down dependency versions more tightly
5
8
 
@@ -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
- begin
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
@@ -1,5 +1,5 @@
1
1
  # vim:fileencoding=utf-8
2
2
 
3
3
  module ResqueScheduler
4
- VERSION = '2.5.2'
4
+ VERSION = '2.5.3'
5
5
  end
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.2
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 00:00:00.000000000 Z
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.3
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