Sha256: c4d7ca82a1b07fe8baa4aaf42dfff83d3a907c1e4d484fac720b051a1cd1f094
Contents?: true
Size: 1.18 KB
Versions: 16
Compression:
Stored size: 1.18 KB
Contents
module ErpTechSvcs module Sessions # Delayed Job to Reset Daily Assignments to Forecast class DeleteExpiredSessionsJob def initialize @priority = 1 end def perform begin process_job rescue => exception ErpTechSvcs::Util::CompassLogger.delete_expired_sessions_job.error("An unrecoverable error has occured, the job will be rescheduled: #{exception.message} : #{exception.backtrace}") end # Run once per day date = Date.tomorrow start_time = DateTime.civil(date.year, date.month, date.day, 2, 0, 1, -(5.0/24.0)) Delayed::Job.enqueue(DeleteExpiredSessionsJob.new(), @priority, start_time) end def self.schedule_job(schedule_dt) Delayed::Job.enqueue(DeleteExpiredSessionsJob.new(), @priority, schedule_dt) end def process_job start_time = Time.now ErpTechSvcs::Sessions::DeleteExpiredSessionsService.new.execute end_time = Time.now return end_time - start_time end end #Close DeleteExpiredSessionsJob end #Close Sessions end #Close ErpTechSvcs
Version data entries
16 entries across 16 versions & 1 rubygems