Merge pull request #10518 from demarches-simplifiees/distinct_cron_tab

Tech: lance les jobs à des horaires légèrements différents pour faciliter le débug
This commit is contained in:
mfo 2024-06-22 03:30:21 +00:00 committed by GitHub
commit 5d0d6e1bbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 25 additions and 25 deletions

View file

@ -1,5 +1,5 @@
class Cron::AdministrateurActivateBeforeExpirationJob < Cron::CronJob class Cron::AdministrateurActivateBeforeExpirationJob < Cron::CronJob
self.schedule_expression = "every day at 8 am" self.schedule_expression = "every day at 08:00"
def perform(*args) def perform(*args)
Administrateur Administrateur

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::AccountByMonthJob < Cron::CronJob class Cron::Datagouv::AccountByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 4:30"
FILE_NAME = "nb_comptes_crees_par_mois" FILE_NAME = "nb_comptes_crees_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob < Cron::CronJob class Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 4:00" self.schedule_expression = "every month at 4:10"
def perform(*args) def perform(*args)
gzip_filepath = [ gzip_filepath = [

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::FileByMonthJob < Cron::CronJob class Cron::Datagouv::FileByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 3:15"
FILE_NAME = "nb_dossiers_crees_par_mois" FILE_NAME = "nb_dossiers_crees_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::FileDeposeByMonthJob < Cron::CronJob class Cron::Datagouv::FileDeposeByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 5:00"
FILE_NAME = "nb_dossiers_deposes_par_mois" FILE_NAME = "nb_dossiers_deposes_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::InstructeurByMonthJob < Cron::CronJob class Cron::Datagouv::InstructeurByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 4:00"
FILE_NAME = "nb_instructeurs_crees_par_mois" FILE_NAME = "nb_instructeurs_crees_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::InstructeurConnectedByMonthJob < Cron::CronJob class Cron::Datagouv::InstructeurConnectedByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 4:45"
FILE_NAME = "nb_instructeurs_connectes_par_mois" FILE_NAME = "nb_instructeurs_connectes_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::ProcedureByMonthJob < Cron::CronJob class Cron::Datagouv::ProcedureByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 4:15"
FILE_NAME = "nb_procedures_creees_par_mois" FILE_NAME = "nb_procedures_creees_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::ProcedureClosedByMonthJob < Cron::CronJob class Cron::Datagouv::ProcedureClosedByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 4:00"
FILE_NAME = "nb_procedures_closes_par_mois" FILE_NAME = "nb_procedures_closes_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::ProcedureDeletedByMonthJob < Cron::CronJob class Cron::Datagouv::ProcedureDeletedByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 3:30"
FILE_NAME = "nb_procedures_supprimees_par_mois" FILE_NAME = "nb_procedures_supprimees_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,6 +1,6 @@
class Cron::Datagouv::UserConnectedWithFranceConnectByMonthJob < Cron::CronJob class Cron::Datagouv::UserConnectedWithFranceConnectByMonthJob < Cron::CronJob
include DatagouvCronSchedulableConcern include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00" self.schedule_expression = "every month at 3:45"
FILE_NAME = "nb_utilisateurs_connectes_france_connect_par_mois" FILE_NAME = "nb_utilisateurs_connectes_france_connect_par_mois"
def perform(*args) def perform(*args)

View file

@ -1,5 +1,5 @@
class Cron::DiscardedDossiersDeletionJob < Cron::CronJob class Cron::DiscardedDossiersDeletionJob < Cron::CronJob
self.schedule_expression = "every day at 2 am" self.schedule_expression = "every day at 02:00"
def perform def perform
Dossier.purge_discarded Dossier.purge_discarded

View file

@ -1,5 +1,5 @@
class Cron::DiscardedProceduresDeletionJob < Cron::CronJob class Cron::DiscardedProceduresDeletionJob < Cron::CronJob
self.schedule_expression = "every day at 1 am" self.schedule_expression = "every day at 00:45"
def perform def perform
Procedure.purge_discarded Procedure.purge_discarded

View file

@ -1,5 +1,5 @@
class Cron::DossierOperationLogMoveToColdStorageJob < Cron::CronJob class Cron::DossierOperationLogMoveToColdStorageJob < Cron::CronJob
self.schedule_expression = "every day at 1 am" self.schedule_expression = "every day at 10:00"
def perform def perform
DossierOperationLog DossierOperationLog

View file

@ -1,5 +1,5 @@
class Cron::FixMissingAntivirusAnalysisJob < Cron::CronJob class Cron::FixMissingAntivirusAnalysisJob < Cron::CronJob
self.schedule_expression = "every day at 2 am" self.schedule_expression = "every day at 01:45"
def perform def perform
ActiveStorage::Blob.where(virus_scan_result: ActiveStorage::VirusScanner::PENDING).find_each do |blob| ActiveStorage::Blob.where(virus_scan_result: ActiveStorage::VirusScanner::PENDING).find_each do |blob|

View file

@ -1,5 +1,5 @@
class Cron::OperationsSignatureJob < Cron::CronJob class Cron::OperationsSignatureJob < Cron::CronJob
self.schedule_expression = "every day at 6 am" self.schedule_expression = "every day at 06:00"
def perform(*args) def perform(*args)
start_date = DossierOperationLog.where(bill_signature: nil).order(:executed_at).pick(:executed_at).beginning_of_day start_date = DossierOperationLog.where(bill_signature: nil).order(:executed_at).pick(:executed_at).beginning_of_day

View file

@ -1,5 +1,5 @@
class Cron::ProcedureExternalURLCheckJob < Cron::CronJob class Cron::ProcedureExternalURLCheckJob < Cron::CronJob
self.schedule_expression = "every week on monday at 1 am" self.schedule_expression = "every week on monday at 01:00"
def perform def perform
Procedure.with_external_urls.find_each { ::ProcedureExternalURLCheckJob.perform_later(_1) } Procedure.with_external_urls.find_each { ::ProcedureExternalURLCheckJob.perform_later(_1) }

View file

@ -1,5 +1,5 @@
class Cron::ProcedureProcessSVASVRJob < Cron::CronJob class Cron::ProcedureProcessSVASVRJob < Cron::CronJob
self.schedule_expression = "every day at 1:00" self.schedule_expression = "every day at 01:15"
def perform def perform
Procedure.sva_svr.find_each do |procedure| Procedure.sva_svr.find_each do |procedure|

View file

@ -1,5 +1,5 @@
class Cron::PurgeManagerAdministrateurSessionsJob < Cron::CronJob class Cron::PurgeManagerAdministrateurSessionsJob < Cron::CronJob
self.schedule_expression = "every day at 3 am" self.schedule_expression = "every day at 02:45"
def perform def perform
# TODO: add id column to administrateurs_procedures and use destroy_all # TODO: add id column to administrateurs_procedures and use destroy_all

View file

@ -1,5 +1,5 @@
class Cron::PurgeOldSibMailsJob < Cron::CronJob class Cron::PurgeOldSibMailsJob < Cron::CronJob
self.schedule_expression = "every day at midnight" self.schedule_expression = "every day at 00:15"
def perform def perform
sib = Sendinblue::API.new sib = Sendinblue::API.new

View file

@ -1,5 +1,5 @@
class Cron::PurgeStaleTransfersJob < Cron::CronJob class Cron::PurgeStaleTransfersJob < Cron::CronJob
self.schedule_expression = "every day at midnight" self.schedule_expression = "every day at 00:00"
def perform def perform
DossierTransfer.destroy_stale DossierTransfer.destroy_stale

View file

@ -1,5 +1,5 @@
class Cron::PurgeUnattachedBlobsJob < Cron::CronJob class Cron::PurgeUnattachedBlobsJob < Cron::CronJob
self.schedule_expression = "every day at midnight" self.schedule_expression = "every day at 00:30"
def perform def perform
# .in_batches { _1.each... } is more efficient in this case that in_batches.each_record or find_each # .in_batches { _1.each... } is more efficient in this case that in_batches.each_record or find_each

View file

@ -1,5 +1,5 @@
class Cron::PurgeUnusedAdminJob < Cron::CronJob class Cron::PurgeUnusedAdminJob < Cron::CronJob
self.schedule_expression = "every monday at 5 am" self.schedule_expression = "every monday at 5:15"
def perform(*args) def perform(*args)
Administrateur.unused.destroy_all Administrateur.unused.destroy_all

View file

@ -1,5 +1,5 @@
class Cron::SendAPITokenExpirationNoticeJob < Cron::CronJob class Cron::SendAPITokenExpirationNoticeJob < Cron::CronJob
self.schedule_expression = "every day at midnight" self.schedule_expression = "every day at 23:45"
def perform def perform
windows = [ windows = [

View file

@ -1,5 +1,5 @@
class Cron::WeeklyOverviewJob < Cron::CronJob class Cron::WeeklyOverviewJob < Cron::CronJob
self.schedule_expression = "every monday at 4 am" self.schedule_expression = "every monday at 04:05"
def perform def perform
# Feature flipped to avoid mails in staging due to unprocessed dossier # Feature flipped to avoid mails in staging due to unprocessed dossier