remove old FindDubiousProceduresJob from delayed_job table

This commit is contained in:
Christophe Robillard 2022-05-17 14:08:30 +02:00
parent a12ab09f8f
commit b6d0d1a101

View file

@ -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