mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-26 03:26:57 +03:00
monitor: Detect shutdown and bail in log reading loop
This should mean not even generating <<JournalEvent>> Tk events once self.thread == None.
This commit is contained in:
1 parent
f3e87f9c24
commit
95b87f5b7b
1 file changed
+5
@@ -327,6 +327,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
||||
loghandle.seek(0, SEEK_END) # required to make macOS notice log change over SMB
|
||||
loghandle.seek(log_pos, SEEK_SET) # reset EOF flag # TODO: log_pos reported as possibly unbound
|
||||
for line in loghandle:
|
||||
# Paranoia check to see if we're shutting down
|
||||
if threading.current_thread() != self.thread:
|
||||
logger.info("We're not meant to be running, exiting...")
|
||||
return # Terminate
|
||||
|
||||
if b'"event":"Location"' in line:
|
||||
logger.trace('Found "Location" event, appending to event_queue')
|
||||
|
||||
|
||||
Reference in new issue
Block a user