Skip to content

Commit

Permalink
Allow Job#queue_signal to take a queue_name
Browse files Browse the repository at this point in the history
Allow Job state transitions to queue a signal on a particular queue_name
allowing states to be run by specific workers.
  • Loading branch information
agrare committed Jan 24, 2020
1 parent f8af5fb commit e1baeab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/job/state_machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ def signal(signal, *args)
end
end

def queue_signal(*args, priority: MiqQueue::NORMAL_PRIORITY, role: nil, deliver_on: nil, server_guid: nil)
def queue_signal(*args, priority: MiqQueue::NORMAL_PRIORITY, role: nil, deliver_on: nil, server_guid: nil, queue_name: nil)
MiqQueue.put(
:class_name => self.class.name,
:method_name => "signal",
:instance_id => id,
:priority => priority,
:role => role,
:zone => zone,
:queue_name => queue_name,
:task_id => guid,
:args => args,
:deliver_on => deliver_on,
Expand Down

0 comments on commit e1baeab

Please sign in to comment.