lib/legion/cli/trigger.rb in legionio-0.4.3 vs lib/legion/cli/trigger.rb in legionio-1.2.0

- old
+ new

@@ -63,19 +63,19 @@ payload[arg.to_sym] = response unless response.empty? end status = options[:delay].zero? ? 'task.queued' : 'task.delayed' task = generate_task_id(function_id: trigger_function.values[:id], status: status, runner_id: trigger_runner.values[:id], args: payload, -delay: options[:delay]) + delay: options[:delay]) unless options[:delay].zero? say "Task: #{task[:task_id]} is queued and will be run in #{options[:delay]}s" return true end routing_key = "#{trigger_extension.values[:exchange]}.#{trigger_runner.values[:queue]}.#{trigger_function.values[:name]}" exchange = Legion::Transport::Messages::Dynamic.new(function: trigger_function.values[:name], function_id: trigger_function.values[:id], -routing_key: routing_key, args: payload) + routing_key: routing_key, args: payload) exchange.options[:task_id] = task[:task_id] exchange.publish if options[:delay].zero? say "Task: #{task[:task_id]} was queued" end