Skip to content

Commit

Permalink
if there is task linked to queue item than make this task ACTIVE when…
Browse files Browse the repository at this point in the history
… deliver
  • Loading branch information
yrudman committed Feb 19, 2018
1 parent 46ddf49 commit b2a1df7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/miq_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def deliver(requester = nil)

def dispatch_method(obj, args)
Timeout.timeout(msg_timeout) do
args = activate_miq_task(args)
obj.send(method_name, *args)
end
end
Expand Down Expand Up @@ -542,6 +543,13 @@ def self.get_worker(task_id)

private

def activate_miq_task(args)
MiqTask.update_status(miq_task_id, MiqTask::STATE_ACTIVE, MiqTask::STATUS_OK, "Task starting") if miq_task
pars = args.first
pars[:miq_task_id] = miq_task_id if pars.kind_of?(Hash)
args
end

# default values for get operations
def self.default_get_options(options)
options.reverse_merge(
Expand Down

0 comments on commit b2a1df7

Please sign in to comment.