From 4cc5514755308a125e83cc8f56681e24c218e1a1 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Sun, 16 Sep 2012 07:27:49 -0700 Subject: [PATCH] Cleanup --- lib/sidekiq/processor.rb | 6 +----- lib/sidekiq/util.rb | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sidekiq/processor.rb b/lib/sidekiq/processor.rb index 63adadbc..aa189d87 100644 --- a/lib/sidekiq/processor.rb +++ b/lib/sidekiq/processor.rb @@ -67,7 +67,7 @@ module Sidekiq conn.multi do conn.sadd('workers', self) conn.setex("worker:#{self}:started", EXPIRY, Time.now.to_s) - hash = {:queue => queue, :payload => msg, :run_at => Time.now.strftime("%Y/%m/%d %H:%M:%S %Z")} + hash = {:queue => queue, :payload => msg, :run_at => Time.now.to_i } conn.setex("worker:#{self}", EXPIRY, Sidekiq.dump_json(hash)) end end @@ -106,9 +106,5 @@ module Sidekiq SINGLETON_CLASSES.include?(val.class) ? val : val.clone end end - - def hostname - @h ||= Socket.gethostname - end end end diff --git a/lib/sidekiq/util.rb b/lib/sidekiq/util.rb index 7fefaab6..e5ac19bb 100644 --- a/lib/sidekiq/util.rb +++ b/lib/sidekiq/util.rb @@ -37,5 +37,9 @@ module Sidekiq def process_id Process.pid end + + def hostname + Socket.gethostname + end end end