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

31 lines
641 B
Ruby
Raw Normal View History

2015-06-03 19:22:21 +00:00
require 'json'
require 'resque'
require 'resque-retry'
require 'net/http'
require 'digest/md5'
module JamRuby
# periodically scheduled to find jobs that need retrying
class TallyAffiliates
extend Resque::Plugins::JamLonelyJob
@queue = :tally_affiliates
@@log = Logging.logger[TallyAffiliates]
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")
AffiliatePartner.tally_up(Date.today)
@@log.debug("done")
end
end
end