lib/reactor/event.rb in reactor-0.4.3 vs lib/reactor/event.rb in reactor-0.4.4
- old
+ new
@@ -53,11 +53,11 @@
end
def process(name, data)
new.perform(name, data)
end
- deprecate process: 'use Event#perform instead'
+ deprecate process: 'use Reactor::Event#perform instead'
def publish(name, data = {})
message = new(data.merge(event: name))
if message.at.nil?
@@ -68,11 +68,12 @@
end
def reschedule(name, data = {})
scheduled_jobs = Sidekiq::ScheduledSet.new
job = scheduled_jobs.detect do |job|
+ job['class'] == self.class.name.to_s
job['args'].first == name.to_s &&
- job.score == data[:was].to_f
+ job.score.to_i == data[:was].to_i
end
job.delete
publish(name, data.except(:was)) if data[:at].future?
end
end