publish eve_orehold_watcher.py

This commit is contained in:
brockdarnold 2026-06-15 01:10:29 +00:00
parent 5beca84cde
commit d354ae1565

View file

@ -56,24 +56,13 @@ CONFIG_PATH = os.path.join(HERE, "config.ini")
def heartbeat(cp, source):
"""Post a one-line 'watcher online' to Discord so installs are verifiable at a
glance. Deduped to at most once per 6h per source to avoid restart spam."""
marker = os.path.join(HERE, f".hb_{source}")
try:
if os.path.exists(marker) and time.time() - os.path.getmtime(marker) < 6 * 3600:
return
except Exception:
pass
"""Show 'watcher online' by EDITING one message per source (no spam on restart).
Defined here so every watcher (all import this module) shares it."""
try:
host = socket.gethostname()
except Exception:
host = "PC"
_discord(cp, "🟢 Watcher online", f"`{source}` running on **{host}**.")
try:
with open(marker, "w") as f:
f.write(str(int(time.time())))
except Exception:
pass
_discord_live(cp, f"hb_{source}", "🟢 Watcher online", f"`{source}` on **{host}**")
# --------------------------------------------------------------------------- #