2023-11-07 07:26:29 +01:00
|
|
|
module Expired
|
2023-11-07 07:47:40 +01:00
|
|
|
REMAINING_WEEKS_BEFORE_EXPIRATION = 2
|
|
|
|
|
2023-11-07 07:26:29 +01:00
|
|
|
def self.schedule_at(caller)
|
|
|
|
case caller.name
|
|
|
|
when 'Cron::ExpiredPrefilledDossiersDeletionJob'
|
|
|
|
"every day at 3 am"
|
|
|
|
when 'Cron::ExpiredDossiersTermineDeletionJob'
|
|
|
|
"every day at 7 am"
|
|
|
|
when 'Cron::ExpiredDossiersBrouillonDeletionJob'
|
|
|
|
"every day at 10 pm"
|
|
|
|
when 'Cron::ExpiredUsersDeletionJob'
|
|
|
|
"every day at 11 pm"
|
|
|
|
when 'Cron::ExpiredDossiersEnConstructionDeletionJob'
|
|
|
|
"every day at 3 pm"
|
|
|
|
else
|
|
|
|
raise 'please, check the schedule to avoid too much email at the same time'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|