From 376c836068f9caf2687c1530745c09778909c6ac Mon Sep 17 00:00:00 2001 From: jaxperro Date: Mon, 6 Jul 2026 16:09:29 -0400 Subject: [PATCH] deploy_bot: banner-wait parses fly log stamps as UTC (timegm, not mktime) Co-Authored-By: Claude Fable 5 --- live/deploy_bot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/live/deploy_bot.sh b/live/deploy_bot.sh index 98eef639..86c75956 100755 --- a/live/deploy_bot.sh +++ b/live/deploy_bot.sh @@ -59,7 +59,7 @@ echo "restart triggered — waiting for the new container…" python3 - <<'PY' # wait for a boot banner logged AFTER the restart (fly log lines are ANSI- # colored and ISO-stamped; strip + parse here rather than in bash) -import re, subprocess, sys, time +import calendar, re, subprocess, sys, time t0 = time.time() - 30 # restart just happened for _ in range(15): time.sleep(20) @@ -69,7 +69,8 @@ for _ in range(15): for l in reversed(lines): if "watching" in l and "wallets" in l: m = re.match(r"(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})Z", l) - ts = time.mktime(time.strptime(m.group(1), "%Y-%m-%dT%H:%M:%S")) - time.timezone if m else 0 + # log stamps are UTC — timegm, NOT mktime (which assumes local) + ts = calendar.timegm(time.strptime(m.group(1), "%Y-%m-%dT%H:%M:%S")) if m else 0 if ts >= t0: print("\n".join(x for x in lines[-40:] if re.search(r"watching|floor\[|push mode|VERDICT", x)))