diff --git a/eve_chat_watcher.py b/eve_chat_watcher.py index 25a26b2..360d994 100644 --- a/eve_chat_watcher.py +++ b/eve_chat_watcher.py @@ -60,11 +60,13 @@ def main(): priority="high", tags="speech_balloon") return + w.heartbeat(cp, "chat") # announce we're alive first d = find_dir(cp) - if not d: - sys.exit("No Chatlogs dir. Set [chat] chatlogs_dir in config.ini.") + while not d: # wait for EVE to create the logs + print("[chat] no Chatlogs dir yet (EVE not started?) — retrying in 30s") + time.sleep(30) + d = find_dir(cp) print(f"[chat] watching {channels} in {d}; keywords={keywords or 'ALL'}") - w.heartbeat(cp, "chat") handles = {} # channel -> (path, fh) last = {} # channel -> last alert time