Add seek_and_destroy_expired_dossier
This commit is contained in:
parent
006e426a11
commit
508ba8f116
3 changed files with 16 additions and 0 deletions
|
@ -77,6 +77,7 @@ En local, un utilisateur de test est créé automatiquement, avec les identifian
|
|||
InstructeurEmailNotificationJob.set(cron: "0 10 * * 1,2,3,4,5,6").perform_later
|
||||
PurgeUnattachedBlobsJob.set(cron: "0 0 * * *").perform_later
|
||||
OperationsSignatureJob.set(cron: "0 6 * * *").perform_later
|
||||
SeekAndDestroyExpiredDossiersJob.set(cron: "0 7 * * *").perform_later
|
||||
|
||||
### Voir les emails envoyés en local
|
||||
|
||||
|
|
8
app/jobs/seek_and_destroy_expired_dossiers_job.rb
Normal file
8
app/jobs/seek_and_destroy_expired_dossiers_job.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
class SeekAndDestroyExpiredDossiersJob < ApplicationJob
|
||||
queue_as :cron
|
||||
|
||||
def perform(*args)
|
||||
Dossier.send_brouillon_expiration_notices
|
||||
Dossier.destroy_brouillons_and_notify
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: enable_seek_and_destroy_job'
|
||||
task enable_seek_and_destroy_job: :environment do
|
||||
SeekAndDestroyExpiredDossiersJob.set(cron: "0 7 * * *").perform_later
|
||||
AfterParty::TaskRecord.create version: '20191203142402'
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue