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