throttle polling outside business hours

Single DAG, single 30-min schedule instead of 5-min or two separate
DAGs. run_sync() itself decides whether to do real work: always during
business hours (default 07:00-17:00 WIB), otherwise only once per
EDOXID_OFF_HOURS_INTERVAL_MINUTES (default 120) tracked via a
last_full_sync timestamp in the sqlite state. Off-hours skips return
immediately without touching DB/Calendar/Gmail at all.
This commit is contained in:
Power BI Dev
2026-07-27 22:33:04 +07:00
parent 7a6dc7d9ae
commit a357e0622e
5 changed files with 90 additions and 9 deletions
+4
View File
@@ -52,6 +52,10 @@ services:
- EDOXID_GOOGLE_CLIENT_ID=${EDOXID_GOOGLE_CLIENT_ID}
- EDOXID_GOOGLE_CLIENT_SECRET=${EDOXID_GOOGLE_CLIENT_SECRET}
- EDOXID_GOOGLE_REFRESH_TOKEN=${EDOXID_GOOGLE_REFRESH_TOKEN}
# jam kerja WIB — di luar rentang ini sync beneran cuma jalan tiap N menit, bukan tiap trigger DAG
- EDOXID_BUSINESS_HOURS_START=${EDOXID_BUSINESS_HOURS_START:-7}
- EDOXID_BUSINESS_HOURS_END=${EDOXID_BUSINESS_HOURS_END:-17}
- EDOXID_OFF_HOURS_INTERVAL_MINUTES=${EDOXID_OFF_HOURS_INTERVAL_MINUTES:-120}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes: