reactor 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reactor/event.rb +1 -1
- data/lib/reactor/version.rb +1 -1
- data/spec/event_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e8f19c123e774ea333ae286291f488e39aba8d0
|
4
|
+
data.tar.gz: d4d2f9c5bebefb6437d2e8d5f7ad4ee5e328a8d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56f87abf1b60898fe5f7145758cf8545ba1d81aa61456986ab526ebcfa390e44bc2f7f0d4253440b813c074df273c48e505d21c3b160ba6240530d4c415e88e7
|
7
|
+
data.tar.gz: e3841ee4fd129af86a4c35652724c5cca93272ca1c4a6dca461db98ec5a2e1818282c50a77bc103188ef1f7afe765ff7a3a3e035851c6f46409a129a249d0dae
|
data/lib/reactor/event.rb
CHANGED
@@ -66,7 +66,7 @@ class Reactor::Event
|
|
66
66
|
def reschedule(name, data = {})
|
67
67
|
scheduled_jobs = Sidekiq::ScheduledSet.new
|
68
68
|
job = scheduled_jobs.detect do |job|
|
69
|
-
|
69
|
+
next if job['class'] != self.name.to_s
|
70
70
|
|
71
71
|
same_event_name = job['args'].first == name.to_s
|
72
72
|
same_at_time = job.score.to_i == data[:was].to_i
|
data/lib/reactor/version.rb
CHANGED
data/spec/event_spec.rb
CHANGED
@@ -11,6 +11,9 @@ end
|
|
11
11
|
class ArbitraryModel < ActiveRecord::Base
|
12
12
|
end
|
13
13
|
|
14
|
+
class OtherWorker
|
15
|
+
include Sidekiq::Worker
|
16
|
+
end
|
14
17
|
|
15
18
|
describe Reactor::Event do
|
16
19
|
|
@@ -113,6 +116,14 @@ describe Reactor::Event do
|
|
113
116
|
Reactor::Event.reschedule :turtle_time, at: time + 2.hours, was: time, actor: actor
|
114
117
|
}.not_to change { scheduled.size}.from(1)
|
115
118
|
end
|
119
|
+
|
120
|
+
it 'will skip jobs of other classes' do
|
121
|
+
OtherWorker.perform_in(1.minute, 'foo')
|
122
|
+
|
123
|
+
expect {
|
124
|
+
Reactor::Event.reschedule :turtle_time, at: time + 2.hours, was: time, actor: actor
|
125
|
+
}.to change { scheduled.size}.from(1).to(2)
|
126
|
+
end
|
116
127
|
end
|
117
128
|
end
|
118
129
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reactor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winfred
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-01-
|
14
|
+
date: 2015-01-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sidekiq
|