add archive creation and purge archives jobs
This commit is contained in:
parent
07cc4fa97f
commit
609a1aa45b
2 changed files with 14 additions and 0 deletions
7
app/jobs/archive_creation_job.rb
Normal file
7
app/jobs/archive_creation_job.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class ArchiveCreationJob < ApplicationJob
|
||||
def perform(procedure, instructeur, type, month)
|
||||
ProcedureArchiveService
|
||||
.new(procedure)
|
||||
.create_archive(instructeur, type, month)
|
||||
end
|
||||
end
|
7
app/jobs/purge_stale_archives_job.rb
Normal file
7
app/jobs/purge_stale_archives_job.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class PurgeStaleArchivesJob < CronJob
|
||||
self.schedule_expression = "every 5 minutes"
|
||||
|
||||
def perform
|
||||
Archive.stale.destroy_all
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue