From 0f7ee8b4d88e17f1966108f185ca6d4cd3c8e194 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 13:27:21 +0000 Subject: [PATCH 1/2] Initial plan From 5b7d6c33524f8980f16a231523eecd4236ac0faf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 13:31:07 +0000 Subject: [PATCH 2/2] Disable mt-check-data-outdated.yml schedule and update check_data_outdated.sh for 3-day lookahead Co-authored-by: mmathieum <177998+mmathieum@users.noreply.github.com> Agent-Logs-Url: https://github.com/mtransitapps/commons/sessions/7340d6a1-54d4-45e6-b403-340d87d64639 --- .../agency-parser/check_data_outdated.sh | 17 ++++++++++++----- .../workflows/mt-check-data-outdated.yml | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/shared-opt-dir/agency-parser/check_data_outdated.sh b/shared-opt-dir/agency-parser/check_data_outdated.sh index 02d98eaf..a5109251 100755 --- a/shared-opt-dir/agency-parser/check_data_outdated.sh +++ b/shared-opt-dir/agency-parser/check_data_outdated.sh @@ -54,8 +54,9 @@ fi echo "> Deployed last departure timestamp: '$DEPLOYED_LAST_DEPARTURE_SEC' (from $DATA_FILE_USED)"; -# Check if deployed data is not outdated (last departure is in the future) -if [[ "$DEPLOYED_LAST_DEPARTURE_SEC" -gt "$NOW_TIMESTAMP_SEC" ]]; then +# Check if deployed data is not outdated (last departure is more than 3 days in the future) +THREE_DAYS_SEC=$((3 * 86400)); +if [[ "$DEPLOYED_LAST_DEPARTURE_SEC" -gt "$((NOW_TIMESTAMP_SEC + THREE_DAYS_SEC))" ]]; then DIFF_SEC=$((DEPLOYED_LAST_DEPARTURE_SEC - NOW_TIMESTAMP_SEC)); DIFF_DAYS=$((DIFF_SEC / 86400)); echo ">> Deployed data has not expired. Last departure will be in $DIFF_DAYS days."; @@ -63,9 +64,15 @@ if [[ "$DEPLOYED_LAST_DEPARTURE_SEC" -gt "$NOW_TIMESTAMP_SEC" ]]; then exit 0; # Exit code 0 indicates data is not outdated fi -DIFF_SEC=$((NOW_TIMESTAMP_SEC - DEPLOYED_LAST_DEPARTURE_SEC)); -DIFF_DAYS=$((DIFF_SEC / 86400)); -echo ">> Deployed data has expired! Last departure was $DIFF_DAYS days ago."; +if [[ "$DEPLOYED_LAST_DEPARTURE_SEC" -gt "$NOW_TIMESTAMP_SEC" ]]; then + DIFF_SEC=$((DEPLOYED_LAST_DEPARTURE_SEC - NOW_TIMESTAMP_SEC)); + DIFF_DAYS=$((DIFF_SEC / 86400)); + echo ">> Deployed data expires in $DIFF_DAYS days (within 3 days). Sync recommended."; +else + DIFF_SEC=$((NOW_TIMESTAMP_SEC - DEPLOYED_LAST_DEPARTURE_SEC)); + DIFF_DAYS=$((DIFF_SEC / 86400)); + echo ">> Deployed data has expired! Last departure was $DIFF_DAYS days ago."; +fi echo ">> Data is OUTDATED. Sync recommended. Looking for available archives..."; # Check archive directory for available data diff --git a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml index bd142647..62ad8107 100644 --- a/shared-overwrite/.github/workflows/mt-check-data-outdated.yml +++ b/shared-overwrite/.github/workflows/mt-check-data-outdated.yml @@ -2,8 +2,8 @@ name: MT check data outdated on: workflow_dispatch: # manual - schedule: - - cron: '0 12 * * 0,1,3,4,6' # Mon, Wed, Thu, Sat & Sun @ 12pm UTC # https://crontab.guru/#0_12_*_*_0,1,3,4,6 + # schedule: # DISABLED + # - cron: '0 12 * * 0,1,3,4,6' # Mon, Wed, Thu, Sat & Sun @ 12pm UTC # https://crontab.guru/#0_12_*_*_0,1,3,4,6 # gh workflow run mt-check-data-outdated.yml --ref $(git rev-parse --abbrev-ref HEAD) # gh run list --workflow=mt-check-data-outdated.yml concurrency: