app/services/change_manager/manager.rb in change_manager-0.1.2 vs app/services/change_manager/manager.rb in change_manager-0.1.5
- old
+ new
@@ -1,11 +1,11 @@
module ChangeManager
class Manager
def self.queue_change(owner, change_type, context, target)
change_id = Change.new_change(owner, change_type, context, target)
# Resque.enqueue(MakeChange, change_id)
- Resque.enqueue_in(30.seconds, ChangeManager::BeginChange, change_id)
+ Resque.enqueue_in(5.minutes, ChangeManager::BeginChange, change_id)
end
def self.process_change(change_id)
unless Change.find(change_id).cancelled?
change = Change.find change_id
@@ -31,9 +31,10 @@
similar_changes.each do |change|
similar_changes.each do |next_change|
if change.inverse_of?(next_change)
change.cancel
next_change.cancel
+ puts 'cancelled inverse changes ' + change.change_type + ' and ' + next_change.change_type
similar_changes.delete_if { |change| change.cancelled? }
end
end
end
return similar_changes