clean(data): remove old cron UpdateAdministrateurUsageStatisticsJob from delayed job table
This commit is contained in:
parent
185f2acdea
commit
863358f389
1 changed files with 14 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
||||||
|
namespace :after_party do
|
||||||
|
desc 'Deployment task: remove_old_cron_job_from_delayed_job_table'
|
||||||
|
task remove_old_cron_job_from_delayed_job_table: :environment do
|
||||||
|
puts "Running deploy task 'remove_old_cron_job_from_delayed_job_table'"
|
||||||
|
|
||||||
|
cron = Delayed::Job.where.not(cron: nil)
|
||||||
|
.where("handler LIKE ?", "%UpdateAdministrateurUsageStatisticsJob%")
|
||||||
|
.first
|
||||||
|
cron.destroy if cron
|
||||||
|
|
||||||
|
AfterParty::TaskRecord
|
||||||
|
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue