resque-pause 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +26 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/resque-pause.rb +2 -1
- data/lib/resque-pause/job.rb +13 -0
- data/lib/{resque → resque-pause}/plugins/pause.rb +0 -0
- data/lib/{resque_pause → resque-pause}/server.rb +4 -0
- data/lib/{resque_pause → resque-pause}/server/public/pause.js +0 -0
- data/lib/{resque_pause → resque-pause}/server/views/pause.erb +0 -0
- data/lib/version.rb +1 -1
- data/spec/{resque → resque-pause}/plugins/pause_spec.rb +20 -6
- data/spec/resque-web_spec.rb +1 -1
- metadata +10 -9
- data/lib/resque_pause.rb +0 -4
data/Changelog.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Changelog
|
2
|
+
=========
|
3
|
+
|
4
|
+
### 0.0.4
|
5
|
+
|
6
|
+
* improvement on job reserve to prevent fork worker when queue is paused
|
7
|
+
* bug fix for the gem work with resque-restriction gem, and other which re-implements job reserve method
|
8
|
+
* changing the require for load resque-web integration to
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'resque-pause/server'
|
12
|
+
```
|
13
|
+
|
14
|
+
### 0.0.3
|
15
|
+
|
16
|
+
* bug fix on re-enqueue the job
|
17
|
+
* improvement on resque-web integration urls
|
18
|
+
|
19
|
+
### 0.0.2
|
20
|
+
|
21
|
+
* updating documentation
|
22
|
+
* generating a good package for rubygems
|
23
|
+
|
24
|
+
### 0.0.1
|
25
|
+
|
26
|
+
* version was removed from rubygems, bad package
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/resque-pause.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
1
|
require 'resque'
|
2
2
|
require File.expand_path(File.join('resque_pause_helper'), File.dirname(__FILE__))
|
3
|
-
require File.expand_path(File.join('resque', 'plugins', 'pause'), File.dirname(__FILE__))
|
3
|
+
require File.expand_path(File.join('resque-pause', 'plugins', 'pause'), File.dirname(__FILE__))
|
4
|
+
require File.expand_path(File.join('resque-pause', 'job'), File.dirname(__FILE__))
|
File without changes
|
File without changes
|
File without changes
|
data/lib/version.rb
CHANGED
@@ -13,10 +13,11 @@ describe Resque::Plugins::Pause do
|
|
13
13
|
expect { Resque::Plugin.lint(Resque::Plugins::Pause) }.to_not raise_error
|
14
14
|
end
|
15
15
|
|
16
|
-
it "should use at least resque version 1.
|
16
|
+
it "should use at least resque version 1.9.10" do
|
17
17
|
major, minor, patch = Resque::Version.split('.')
|
18
18
|
major.to_i.should == 1
|
19
|
-
minor.to_i.should >=
|
19
|
+
minor.to_i.should >= 9
|
20
|
+
patch.to_i.should >= 10 if minor.to_i == 9
|
20
21
|
end
|
21
22
|
|
22
23
|
it "should execute the job when queue is not paused" do
|
@@ -27,21 +28,33 @@ describe Resque::Plugins::Pause do
|
|
27
28
|
end
|
28
29
|
|
29
30
|
it "should not execute the job when queue is paused" do
|
31
|
+
Resque.enqueue(PauseJob)
|
32
|
+
Resque.size('test').should == 1
|
33
|
+
|
34
|
+
job = Resque.reserve('test')
|
35
|
+
ResquePauseHelper.pause('test')
|
36
|
+
job.perform
|
37
|
+
|
38
|
+
Resque.size('test').should == 1
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should not reserve the job when queue is paused" do
|
30
42
|
ResquePauseHelper.pause('test')
|
31
43
|
Resque.enqueue(PauseJob)
|
32
44
|
PauseJob.should_not_receive(:perform)
|
33
45
|
|
34
|
-
Resque.reserve('test').
|
46
|
+
Resque.reserve('test').should be_nil
|
35
47
|
end
|
36
48
|
|
37
49
|
it "should not change queued jobs when queue is paused" do
|
38
|
-
ResquePauseHelper.pause('test')
|
39
50
|
Resque.enqueue(PauseJob, 1)
|
40
51
|
Resque.enqueue(PauseJob, 2)
|
41
52
|
Resque.enqueue(PauseJob, 3)
|
42
53
|
jobs = Resque.redis.lrange('queue:test', 0, 2)
|
43
54
|
|
44
|
-
Resque.reserve('test')
|
55
|
+
job = Resque.reserve('test')
|
56
|
+
ResquePauseHelper.pause('test')
|
57
|
+
job.perform
|
45
58
|
|
46
59
|
remaining_jobs = Resque.redis.lrange('queue:test', 0, 2)
|
47
60
|
jobs.should == remaining_jobs
|
@@ -50,8 +63,9 @@ describe Resque::Plugins::Pause do
|
|
50
63
|
it "should back to execute the job when queue is unpaused" do
|
51
64
|
Resque.enqueue(PauseJob)
|
52
65
|
|
66
|
+
job = Resque.reserve('test')
|
53
67
|
ResquePauseHelper.pause('test')
|
54
|
-
|
68
|
+
job.perform
|
55
69
|
Resque.size('test').should == 1
|
56
70
|
|
57
71
|
ResquePauseHelper.unpause('test')
|
data/spec/resque-web_spec.rb
CHANGED
@@ -67,7 +67,7 @@ describe ResquePause::Server do
|
|
67
67
|
|
68
68
|
it "should return static files" do
|
69
69
|
get "/pause/public/pause.js"
|
70
|
-
last_response.body.should == File.read(File.expand_path('../lib/
|
70
|
+
last_response.body.should == File.read(File.expand_path('../lib/resque-pause/server/public/pause.js', File.dirname(__FILE__)))
|
71
71
|
end
|
72
72
|
|
73
73
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 4
|
9
|
+
version: 0.0.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Wandenberg Peixoto
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-06-
|
17
|
+
date: 2011-06-30 00:00:00 -03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -92,22 +92,23 @@ extra_rdoc_files: []
|
|
92
92
|
|
93
93
|
files:
|
94
94
|
- .gitignore
|
95
|
+
- Changelog.md
|
95
96
|
- Gemfile
|
96
97
|
- Gemfile.lock
|
97
98
|
- README.md
|
98
99
|
- Rakefile
|
99
100
|
- lib/resque-pause.rb
|
100
|
-
- lib/resque/
|
101
|
-
- lib/
|
102
|
-
- lib/
|
103
|
-
- lib/
|
104
|
-
- lib/
|
101
|
+
- lib/resque-pause/job.rb
|
102
|
+
- lib/resque-pause/plugins/pause.rb
|
103
|
+
- lib/resque-pause/server.rb
|
104
|
+
- lib/resque-pause/server/public/pause.js
|
105
|
+
- lib/resque-pause/server/views/pause.erb
|
105
106
|
- lib/resque_pause_helper.rb
|
106
107
|
- lib/version.rb
|
107
108
|
- resque-pause.gemspec
|
108
109
|
- spec/redis-test.conf
|
110
|
+
- spec/resque-pause/plugins/pause_spec.rb
|
109
111
|
- spec/resque-web_spec.rb
|
110
|
-
- spec/resque/plugins/pause_spec.rb
|
111
112
|
- spec/resque_pause_helper_spec.rb
|
112
113
|
- spec/spec_helper.rb
|
113
114
|
has_rdoc: true
|
data/lib/resque_pause.rb
DELETED