mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-10-04 13:42:07 +00:00
Add force flag to roster sync DST guard
This commit is contained in:
parent
81b1a8d061
commit
093bb43e71
1 changed files with 2 additions and 1 deletions
|
|
@ -39,7 +39,8 @@ def handler(event, context):
|
||||||
now = datetime.now(EASTERN)
|
now = datetime.now(EASTERN)
|
||||||
|
|
||||||
# DST guard — two EventBridge rules fire, only one is at 6am ET
|
# DST guard — two EventBridge rules fire, only one is at 6am ET
|
||||||
if now.hour != 6:
|
force = event.get("force", False)
|
||||||
|
if not force and now.hour != 6:
|
||||||
logger.info("ET hour is %d, not 6am — skipping (wrong DST rule fired)", now.hour)
|
logger.info("ET hour is %d, not 6am — skipping (wrong DST rule fired)", now.hour)
|
||||||
return {"skipped": True}
|
return {"skipped": True}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue