lib/lazylead/schedule.rb in lazylead-0.11.4 vs lib/lazylead/schedule.rb in lazylead-0.12.0
- old
+ new
@@ -45,17 +45,13 @@
# like ll-xxx.
def register(task)
raise "ll-002: task can't be a null" if task.nil?
@trigger.method(task.type).call(task.unit) do
ActiveRecord::Base.connection_pool.with_connection do
- if task.props.key? "no_logs"
- ORM::Retry.new(task, @log).exec
- else
- ORM::Retry.new(
- ORM::Verbose.new(task, @log),
- @log
- ).exec
- end
+ t = task
+ t = ORM::Verbose.new(t, @log) unless t.props.key? "no_logs"
+ t = ORM::Retry.new(t, @log)
+ t.exec
end
end
@log.debug "Task scheduled: #{task}"
end