Add purge stale export job

This commit is contained in:
simon lehericey 2019-11-27 14:56:08 +01:00
parent d0939ae1a4
commit ce7ab89934
3 changed files with 16 additions and 0 deletions

View file

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

View file

@ -0,0 +1,7 @@
class PurgeStaleExportsJob < ApplicationJob
queue_as :cron
def perform
Export.stale.destroy_all
end
end

View file

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