From 7c1b26930b47e64c41e18d356e2962df948e9880 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 13 Jun 2024 16:40:08 +0200 Subject: [PATCH] tech: move cron tab to specific time --- app/jobs/cron/administrateur_activate_before_expiration_job.rb | 2 +- app/jobs/cron/datagouv/account_by_month_job.rb | 2 +- .../cron/datagouv/export_and_publish_demarches_publiques_job.rb | 2 +- app/jobs/cron/datagouv/file_by_month_job.rb | 2 +- app/jobs/cron/datagouv/file_depose_by_month_job.rb | 2 +- app/jobs/cron/datagouv/instructeur_by_month_job.rb | 2 +- app/jobs/cron/datagouv/instructeur_connected_by_month_job.rb | 2 +- app/jobs/cron/datagouv/procedure_by_month_job.rb | 2 +- app/jobs/cron/datagouv/procedure_closed_by_month_job.rb | 2 +- app/jobs/cron/datagouv/procedure_deleted_by_month_job.rb | 2 +- .../datagouv/user_connected_with_france_connect_by_month_job.rb | 2 +- app/jobs/cron/discarded_dossiers_deletion_job.rb | 2 +- app/jobs/cron/discarded_procedures_deletion_job.rb | 2 +- app/jobs/cron/dossier_operation_log_move_to_cold_storage_job.rb | 2 +- app/jobs/cron/fix_missing_antivirus_analysis_job.rb | 2 +- app/jobs/cron/operations_signature_job.rb | 2 +- app/jobs/cron/procedure_external_url_check_job.rb | 2 +- app/jobs/cron/procedure_process_sva_svr_job.rb | 2 +- app/jobs/cron/purge_manager_administrateur_sessions_job.rb | 2 +- app/jobs/cron/purge_old_sib_mails_job.rb | 2 +- app/jobs/cron/purge_stale_transfers_job.rb | 2 +- app/jobs/cron/purge_unattached_blobs_job.rb | 2 +- app/jobs/cron/purge_unused_admin_job.rb | 2 +- app/jobs/cron/send_api_token_expiration_notice_job.rb | 2 +- app/jobs/cron/weekly_overview_job.rb | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/jobs/cron/administrateur_activate_before_expiration_job.rb b/app/jobs/cron/administrateur_activate_before_expiration_job.rb index 0c5779e16..44aab461e 100644 --- a/app/jobs/cron/administrateur_activate_before_expiration_job.rb +++ b/app/jobs/cron/administrateur_activate_before_expiration_job.rb @@ -1,5 +1,5 @@ class Cron::AdministrateurActivateBeforeExpirationJob < Cron::CronJob - self.schedule_expression = "every day at 8 am" + self.schedule_expression = "every day at 08:00" def perform(*args) Administrateur diff --git a/app/jobs/cron/datagouv/account_by_month_job.rb b/app/jobs/cron/datagouv/account_by_month_job.rb index 187da87db..a05bb00f6 100644 --- a/app/jobs/cron/datagouv/account_by_month_job.rb +++ b/app/jobs/cron/datagouv/account_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::AccountByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/export_and_publish_demarches_publiques_job.rb b/app/jobs/cron/datagouv/export_and_publish_demarches_publiques_job.rb index c11b8eec4..6c233ac36 100644 --- a/app/jobs/cron/datagouv/export_and_publish_demarches_publiques_job.rb +++ b/app/jobs/cron/datagouv/export_and_publish_demarches_publiques_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob < Cron::CronJob include DatagouvCronSchedulableConcern - self.schedule_expression = "every month at 4:00" + self.schedule_expression = "every month at 4:10" def perform(*args) gzip_filepath = [ diff --git a/app/jobs/cron/datagouv/file_by_month_job.rb b/app/jobs/cron/datagouv/file_by_month_job.rb index 7cf7b0357..bba0db5d5 100644 --- a/app/jobs/cron/datagouv/file_by_month_job.rb +++ b/app/jobs/cron/datagouv/file_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::FileByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/file_depose_by_month_job.rb b/app/jobs/cron/datagouv/file_depose_by_month_job.rb index 4191356e9..854c803c4 100644 --- a/app/jobs/cron/datagouv/file_depose_by_month_job.rb +++ b/app/jobs/cron/datagouv/file_depose_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::FileDeposeByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/instructeur_by_month_job.rb b/app/jobs/cron/datagouv/instructeur_by_month_job.rb index ea98d5dd9..dd2aaf3c4 100644 --- a/app/jobs/cron/datagouv/instructeur_by_month_job.rb +++ b/app/jobs/cron/datagouv/instructeur_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::InstructeurByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/instructeur_connected_by_month_job.rb b/app/jobs/cron/datagouv/instructeur_connected_by_month_job.rb index cbcb20e08..2759585ad 100644 --- a/app/jobs/cron/datagouv/instructeur_connected_by_month_job.rb +++ b/app/jobs/cron/datagouv/instructeur_connected_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::InstructeurConnectedByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/procedure_by_month_job.rb b/app/jobs/cron/datagouv/procedure_by_month_job.rb index 2a044cf43..615941418 100644 --- a/app/jobs/cron/datagouv/procedure_by_month_job.rb +++ b/app/jobs/cron/datagouv/procedure_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::ProcedureByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/procedure_closed_by_month_job.rb b/app/jobs/cron/datagouv/procedure_closed_by_month_job.rb index 315aa7474..5240d33a8 100644 --- a/app/jobs/cron/datagouv/procedure_closed_by_month_job.rb +++ b/app/jobs/cron/datagouv/procedure_closed_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::ProcedureClosedByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/procedure_deleted_by_month_job.rb b/app/jobs/cron/datagouv/procedure_deleted_by_month_job.rb index 17bdccf63..7417b8dcd 100644 --- a/app/jobs/cron/datagouv/procedure_deleted_by_month_job.rb +++ b/app/jobs/cron/datagouv/procedure_deleted_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::ProcedureDeletedByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/datagouv/user_connected_with_france_connect_by_month_job.rb b/app/jobs/cron/datagouv/user_connected_with_france_connect_by_month_job.rb index a4aea9be7..442ebbfd4 100644 --- a/app/jobs/cron/datagouv/user_connected_with_france_connect_by_month_job.rb +++ b/app/jobs/cron/datagouv/user_connected_with_france_connect_by_month_job.rb @@ -1,6 +1,6 @@ class Cron::Datagouv::UserConnectedWithFranceConnectByMonthJob < Cron::CronJob 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" def perform(*args) diff --git a/app/jobs/cron/discarded_dossiers_deletion_job.rb b/app/jobs/cron/discarded_dossiers_deletion_job.rb index 9db9623bf..3381003fb 100644 --- a/app/jobs/cron/discarded_dossiers_deletion_job.rb +++ b/app/jobs/cron/discarded_dossiers_deletion_job.rb @@ -1,5 +1,5 @@ class Cron::DiscardedDossiersDeletionJob < Cron::CronJob - self.schedule_expression = "every day at 2 am" + self.schedule_expression = "every day at 02:00" def perform Dossier.purge_discarded diff --git a/app/jobs/cron/discarded_procedures_deletion_job.rb b/app/jobs/cron/discarded_procedures_deletion_job.rb index d67cde8a9..0958ea3f8 100644 --- a/app/jobs/cron/discarded_procedures_deletion_job.rb +++ b/app/jobs/cron/discarded_procedures_deletion_job.rb @@ -1,5 +1,5 @@ class Cron::DiscardedProceduresDeletionJob < Cron::CronJob - self.schedule_expression = "every day at 1 am" + self.schedule_expression = "every day at 00:45" def perform Procedure.purge_discarded diff --git a/app/jobs/cron/dossier_operation_log_move_to_cold_storage_job.rb b/app/jobs/cron/dossier_operation_log_move_to_cold_storage_job.rb index e4159317f..d0788fc37 100644 --- a/app/jobs/cron/dossier_operation_log_move_to_cold_storage_job.rb +++ b/app/jobs/cron/dossier_operation_log_move_to_cold_storage_job.rb @@ -1,5 +1,5 @@ class Cron::DossierOperationLogMoveToColdStorageJob < Cron::CronJob - self.schedule_expression = "every day at 1 am" + self.schedule_expression = "every day at 10:00" def perform DossierOperationLog diff --git a/app/jobs/cron/fix_missing_antivirus_analysis_job.rb b/app/jobs/cron/fix_missing_antivirus_analysis_job.rb index 52bb90848..1ccff24aa 100644 --- a/app/jobs/cron/fix_missing_antivirus_analysis_job.rb +++ b/app/jobs/cron/fix_missing_antivirus_analysis_job.rb @@ -1,5 +1,5 @@ class Cron::FixMissingAntivirusAnalysisJob < Cron::CronJob - self.schedule_expression = "every day at 2 am" + self.schedule_expression = "every day at 01:45" def perform ActiveStorage::Blob.where(virus_scan_result: ActiveStorage::VirusScanner::PENDING).find_each do |blob| diff --git a/app/jobs/cron/operations_signature_job.rb b/app/jobs/cron/operations_signature_job.rb index 6985ac040..f447ac081 100644 --- a/app/jobs/cron/operations_signature_job.rb +++ b/app/jobs/cron/operations_signature_job.rb @@ -1,5 +1,5 @@ class Cron::OperationsSignatureJob < Cron::CronJob - self.schedule_expression = "every day at 6 am" + self.schedule_expression = "every day at 06:00" def perform(*args) start_date = DossierOperationLog.where(bill_signature: nil).order(:executed_at).pick(:executed_at).beginning_of_day diff --git a/app/jobs/cron/procedure_external_url_check_job.rb b/app/jobs/cron/procedure_external_url_check_job.rb index ab18c8c37..9ec892ec7 100644 --- a/app/jobs/cron/procedure_external_url_check_job.rb +++ b/app/jobs/cron/procedure_external_url_check_job.rb @@ -1,5 +1,5 @@ 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 Procedure.with_external_urls.find_each { ::ProcedureExternalURLCheckJob.perform_later(_1) } diff --git a/app/jobs/cron/procedure_process_sva_svr_job.rb b/app/jobs/cron/procedure_process_sva_svr_job.rb index cda3e8468..b66aa0941 100644 --- a/app/jobs/cron/procedure_process_sva_svr_job.rb +++ b/app/jobs/cron/procedure_process_sva_svr_job.rb @@ -1,5 +1,5 @@ class Cron::ProcedureProcessSVASVRJob < Cron::CronJob - self.schedule_expression = "every day at 1:00" + self.schedule_expression = "every day at 01:15" def perform Procedure.sva_svr.find_each do |procedure| diff --git a/app/jobs/cron/purge_manager_administrateur_sessions_job.rb b/app/jobs/cron/purge_manager_administrateur_sessions_job.rb index b85714dd5..c9e2bc3d9 100644 --- a/app/jobs/cron/purge_manager_administrateur_sessions_job.rb +++ b/app/jobs/cron/purge_manager_administrateur_sessions_job.rb @@ -1,5 +1,5 @@ class Cron::PurgeManagerAdministrateurSessionsJob < Cron::CronJob - self.schedule_expression = "every day at 3 am" + self.schedule_expression = "every day at 02:45" def perform # TODO: add id column to administrateurs_procedures and use destroy_all diff --git a/app/jobs/cron/purge_old_sib_mails_job.rb b/app/jobs/cron/purge_old_sib_mails_job.rb index 3ed3685a9..f5f94fb03 100644 --- a/app/jobs/cron/purge_old_sib_mails_job.rb +++ b/app/jobs/cron/purge_old_sib_mails_job.rb @@ -1,5 +1,5 @@ class Cron::PurgeOldSibMailsJob < Cron::CronJob - self.schedule_expression = "every day at midnight" + self.schedule_expression = "every day at 00:15" def perform sib = Sendinblue::API.new diff --git a/app/jobs/cron/purge_stale_transfers_job.rb b/app/jobs/cron/purge_stale_transfers_job.rb index bf54c1c81..5d92eefc4 100644 --- a/app/jobs/cron/purge_stale_transfers_job.rb +++ b/app/jobs/cron/purge_stale_transfers_job.rb @@ -1,5 +1,5 @@ class Cron::PurgeStaleTransfersJob < Cron::CronJob - self.schedule_expression = "every day at midnight" + self.schedule_expression = "every day at 00:00" def perform DossierTransfer.destroy_stale diff --git a/app/jobs/cron/purge_unattached_blobs_job.rb b/app/jobs/cron/purge_unattached_blobs_job.rb index 218b6f5d2..d43e84030 100644 --- a/app/jobs/cron/purge_unattached_blobs_job.rb +++ b/app/jobs/cron/purge_unattached_blobs_job.rb @@ -1,5 +1,5 @@ class Cron::PurgeUnattachedBlobsJob < Cron::CronJob - self.schedule_expression = "every day at midnight" + self.schedule_expression = "every day at 00:30" def perform # .in_batches { _1.each... } is more efficient in this case that in_batches.each_record or find_each diff --git a/app/jobs/cron/purge_unused_admin_job.rb b/app/jobs/cron/purge_unused_admin_job.rb index d58f479d4..c16cc5d9c 100644 --- a/app/jobs/cron/purge_unused_admin_job.rb +++ b/app/jobs/cron/purge_unused_admin_job.rb @@ -1,5 +1,5 @@ class Cron::PurgeUnusedAdminJob < Cron::CronJob - self.schedule_expression = "every monday at 5 am" + self.schedule_expression = "every monday at 5:15" def perform(*args) Administrateur.unused.destroy_all diff --git a/app/jobs/cron/send_api_token_expiration_notice_job.rb b/app/jobs/cron/send_api_token_expiration_notice_job.rb index 48d69c0d8..37234036b 100644 --- a/app/jobs/cron/send_api_token_expiration_notice_job.rb +++ b/app/jobs/cron/send_api_token_expiration_notice_job.rb @@ -1,5 +1,5 @@ class Cron::SendAPITokenExpirationNoticeJob < Cron::CronJob - self.schedule_expression = "every day at midnight" + self.schedule_expression = "every day at 23:45" def perform windows = [ diff --git a/app/jobs/cron/weekly_overview_job.rb b/app/jobs/cron/weekly_overview_job.rb index 45408c58d..965aa4f64 100644 --- a/app/jobs/cron/weekly_overview_job.rb +++ b/app/jobs/cron/weekly_overview_job.rb @@ -1,5 +1,5 @@ class Cron::WeeklyOverviewJob < Cron::CronJob - self.schedule_expression = "every monday at 4 am" + self.schedule_expression = "every monday at 04:05" def perform # Feature flipped to avoid mails in staging due to unprocessed dossier