BUGFIX: recovery code in case an unknown job is scheduled

This commit is contained in:
Sam
2014-03-04 07:36:50 +11:00
parent a05606d1ff
commit 5c3f2feed4
2 changed files with 12 additions and 1 deletions

View File

@@ -184,7 +184,11 @@ module Scheduler
return unless key
if due.to_i <= Time.now.to_i
klass = get_klass(key)
return unless klass
unless klass
# corrupt key, nuke it (renamed job or something)
redis.zrem Manager.queue_key, key
return
end
info = schedule_info(klass)
info.prev_run = Time.now.to_i
info.prev_result = "QUEUED"