lib/litejob/client.rb in litejob-0.2.1 vs lib/litejob/client.rb in litejob-0.2.2

- old
+ new

@@ -13,14 +13,17 @@ def push(jobclass, params, options = {}) delay = options[:delay] || 0 attempts = options[:attempts] || 5 queue = options[:queue] payload = JSON.dump({class: jobclass, params: params, attempts: attempts, queue: queue}) - atomic_push(payload, delay, queue) + job_id, job_queue = atomic_push(payload, delay, queue) + Litejob.logger.info("[litejob]:[ENQ] queue=#{job_queue} class=#{jobclass} job=#{job_id}") + [job_id, job_queue] end def delete(id) payload = @queue.delete(id) + Litejob.logger.info("[litejob]:[DEL] job=#{id}") JSON.parse(payload) end private