jam-cloud/ruby/lib/jam_ruby/resque/scheduled/icecast_config_retry.rb

31 lines
668 B
Ruby

require 'json'
require 'resque'
require 'resque-retry'
require 'net/http'
require 'digest/md5'
module JamRuby
# periodically scheduled to find jobs that need retrying
class IcecastConfigRetry
extend Resque::Plugins::JamLonelyJob
@queue = :scheduled_icecast_config_retry
@@log = Logging.logger[IcecastConfigRetry]
def self.lock_timeout
# this should be enough time to make sure the job has finished, but not so long that the system isn't recovering from a abandoned job
120
end
def self.perform
@@log.debug("waking up")
IcecastConfigWriter.queue_jobs_needing_retry
@@log.debug("done")
end
end
end