lib/zhong/job.rb in zhong-0.2.0 vs lib/zhong/job.rb in zhong-0.2.1

- old
+ new

@@ -21,10 +21,11 @@ @if = config[:if] @long_running_timeout = config[:long_running_timeout] @running = false @first_run = true + @last_ran = nil @id = Digest::SHA256.hexdigest(@name) end def run?(time = Time.now) if @first_run @@ -181,9 +182,9 @@ @last_ran = time redis.set(last_ran_key, @last_ran.to_i) end def redis_lock - @lock ||= Suo::Client::Redis.new(lock_key, client: @redis, stale_lock_expiration: @long_running_timeout) + @lock ||= Suo::Client::Redis.new(lock_key, client: redis, stale_lock_expiration: @long_running_timeout) end end end