feat(cron): simplify to single expression — 00:00 + hourly 05-23 UTC+7

This commit is contained in:
tiennm99 committed 2026-05-09 11:58:10 +07:00
1 parent 4626889387
commit 723f5773fa
3 files changed
+8 -22

No files matched your search

+4 -14
View File
@@ -11,22 +11,12 @@ TZ = "Asia/Ho_Chi_Minh"
# Cron triggers fire from this list. CF Workers requires literal cron
# expressions here — they cannot be loaded from env vars or secrets.
# Schedule (Asia/Ho_Chi_Minh, UTC+7) — 20 fires/day, packed into 5 expressions:
# 00:00 — once at local midnight
# 05:01-09:01 — every hour, minute 01
# 10:02-14:02 — every hour, minute 02
# 15:03-19:03 — every hour, minute 03
# 20:04-23:04 — every hour, minute 04
# Crons evaluate in UTC, so each row is offset by -7 hours; the 05-09 row
# wraps midnight UTC so it uses a comma list rather than a range.
# Free tier allows up to 5 cron expressions per worker — at limit.
# Schedule (Asia/Ho_Chi_Minh, UTC+7): hourly at :00 from 05:00 to 23:00,
# plus a single fire at 00:00 — 20 fires/day, every hour except 01-04.
# Crons evaluate in UTC; UTC+7 hours {00, 05..23} map to UTC {17, 22-23, 0-16}.
[triggers]
crons = [
"0 17 * * *", # 00:00 UTC+7 (17:00 UTC prev day)
"1 22,23,0,1,2 * * *", # 05:01-09:01 UTC+7
"2 3-7 * * *", # 10:02-14:02 UTC+7
"3 8-12 * * *", # 15:03-19:03 UTC+7
"4 13-16 * * *", # 20:04-23:04 UTC+7
"0 0-17,22-23 * * *", # UTC+7: 00:00 + 05:00..23:00 hourly
]
# Built-in observability (free tier supports basic logs).