Add purge stale export job
This commit is contained in:
parent
d0939ae1a4
commit
ce7ab89934
3 changed files with 16 additions and 0 deletions
|
@ -78,6 +78,7 @@ En local, un utilisateur de test est créé automatiquement, avec les identifian
|
|||
PurgeUnattachedBlobsJob.set(cron: "0 0 * * *").perform_later
|
||||
OperationsSignatureJob.set(cron: "0 6 * * *").perform_later
|
||||
SeekAndDestroyExpiredDossiersJob.set(cron: "0 7 * * *").perform_later
|
||||
PurgeStaleExportsJob.set(cron: "*/5 * * * *").perform_later
|
||||
|
||||
### Voir les emails envoyés en local
|
||||
|
||||
|
|
7
app/jobs/purge_stale_export_jobs.rb
Normal file
7
app/jobs/purge_stale_export_jobs.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class PurgeStaleExportsJob < ApplicationJob
|
||||
queue_as :cron
|
||||
|
||||
def perform
|
||||
Export.stale.destroy_all
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: enable_export_purge'
|
||||
task enable_export_purge: :environment do
|
||||
PurgeStaleExportsJob.set(cron: "*/5 * * * *").perform_later
|
||||
|
||||
AfterParty::TaskRecord.create version: '20191127135401'
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue