reactor 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 703450e6a7d56fa44bbfcfa8a9eed1263df5cc0b
4
- data.tar.gz: f2e523fbc25b98abeb47b5f67d16b4cbf6b388e7
3
+ metadata.gz: 2f68e85e0e74847f96c21488a9c501839d9f6e63
4
+ data.tar.gz: 9a604a01797f2ca97b72510ab25442e505853630
5
5
  SHA512:
6
- metadata.gz: b9d620ea6f462727a488d71c236420a18f36bca937916d58836604de3098d4a2e638527aa9c9e502ee0040cd55d79b179ccc1291b0f969c149d0369a7f38391f
7
- data.tar.gz: 442cf06b6d18b3ef38347836d072b1cf3bfe1907f1d28e44048f1e451b74aec0006224741c27a5b1f07d977a0ae3ed25beb5670037d76f890c9e0d4ddef623cd
6
+ metadata.gz: c7d15a00dd0bcac36828b89a4a5aee6b953dc955beba2243e057268902466acf56e3f8357a27857d70a2425c22aef54372903bedbb1e88ab78562fc0c9fde3e2
7
+ data.tar.gz: bd054bf8cfd108603c718d9cb39ff10d2010fdc2744e8a898e2f950cda19f30ab5af1528fb3eeb9bc6156f3c7039f0dc7d6b9957b62a0e6f2dd07217906a8c0e
data/lib/reactor/event.rb CHANGED
@@ -66,23 +66,18 @@ 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
- same_class = job['class'] == self.name.to_s
70
- same_name = job['args'].first == name.to_s
71
- same_at = job.score.to_i == data[:was].to_i
69
+ return false if job['class'] != self.name.to_s
72
70
 
73
- if data[:actor]
74
- job_data = job['args'].second
71
+ same_event_name = job['args'].first == name.to_s
72
+ same_at_time = job.score.to_i == data[:was].to_i
75
73
 
76
- if job_data
77
- same_actor = job_data['actor_type'] == data[:actor].class.name &&
78
- job_data['actor_id'] == data[:actor].id
79
- else
80
- same_actor = false
81
- end
74
+ if data[:actor]
75
+ same_actor = job['args'].second['actor_type'] == data[:actor].class.name &&
76
+ job['args'].second['actor_id'] == data[:actor].id
82
77
 
83
- same_class && same_name && same_at && same_actor
78
+ same_event_name && same_at_time && same_actor
84
79
  else
85
- same_class && same_name && same_at
80
+ same_event_name && same_at_time
86
81
  end
87
82
  end
88
83
 
@@ -1,3 +1,3 @@
1
1
  module Reactor
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
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
4
+ version: 0.9.5
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-06 00:00:00.000000000 Z
14
+ date: 2015-01-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sidekiq