add archive creation and purge archives jobs

This commit is contained in:
Christophe Robillard 2021-03-30 10:12:18 +02:00
parent 07cc4fa97f
commit 609a1aa45b
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,7 @@
class ArchiveCreationJob < ApplicationJob
def perform(procedure, instructeur, type, month)
ProcedureArchiveService
.new(procedure)
.create_archive(instructeur, type, month)
end
end

View file

@ -0,0 +1,7 @@
class PurgeStaleArchivesJob < CronJob
self.schedule_expression = "every 5 minutes"
def perform
Archive.stale.destroy_all
end
end