From 1f7415845a0ca8b25078a63812a5860a5cc18ec2 Mon Sep 17 00:00:00 2001 From: "Michael B. Klein" Date: Tue, 11 Jun 2024 18:50:29 +0000 Subject: [PATCH] Read preservation check schedule from secrets manager Default is the production schedule (2am Chicago time) --- app/config/releases.exs | 7 +++++-- infrastructure/deploy/secrets.tf | 4 ++++ infrastructure/deploy/variables.tf | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/config/releases.exs b/app/config/releases.exs index 3c30ca57b..0b2dafcbc 100644 --- a/app/config/releases.exs +++ b/app/config/releases.exs @@ -125,8 +125,11 @@ config :meadow, Meadow.Scheduler, overlap: false, timezone: "America/Chicago", jobs: [ - # Runs daily at 2AM Central Time - {"0 2 * * *", {Meadow.Data.PreservationChecks, :start_job, []}} + # Runs daily at the configured time (default: 2AM Central) + { + aws_secret("meadow", dig: ["scheduler", "preservation_check"], default: "0 2 * * *"), + {Meadow.Data.PreservationChecks, :start_job, []} + } ] config :ueberauth, Ueberauth, diff --git a/infrastructure/deploy/secrets.tf b/infrastructure/deploy/secrets.tf index 5398c7093..9cba87e33 100644 --- a/infrastructure/deploy/secrets.tf +++ b/infrastructure/deploy/secrets.tf @@ -87,6 +87,10 @@ locals { tiff = module.pipeline_lambda["tiff"].lambda_function_arn } + scheduler = { + preservation_check = var.preservation_check_schedule + } + streaming = { base_url = "https://${aws_route53_record.meadow_streaming_cloudfront.fqdn}/" distribution_id = aws_cloudfront_distribution.meadow_streaming.id diff --git a/infrastructure/deploy/variables.tf b/infrastructure/deploy/variables.tf index a21b156f3..ad77df398 100644 --- a/infrastructure/deploy/variables.tf +++ b/infrastructure/deploy/variables.tf @@ -195,6 +195,11 @@ variable "streaming_config" { } } +variable "preservation_check_schedule" { + type = string + default = "0 2 * * *" +} + variable "trusted_referers" { type = string default = ""