mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-16 07:12:17 +03:00
Fall back to polling if watchdog thread dies
This commit is contained in:
parent
28169cc404
commit
3bfa67663a
@ -222,6 +222,9 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
else:
|
else:
|
||||||
loghandle = None
|
loghandle = None
|
||||||
|
|
||||||
|
# Watchdog thread
|
||||||
|
emitter = self.observed and self.observer._emitter_for_watch[self.observed] # Note: Uses undocumented attribute
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
if docked and not updated and not config.getint('output') & config.OUT_MKT_MANUAL:
|
if docked and not updated and not config.getint('output') & config.OUT_MKT_MANUAL:
|
||||||
@ -231,7 +234,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
print "%s :\t%s %s" % ('Updated', docked and " docked" or "!docked", updated and " updated" or "!updated")
|
print "%s :\t%s %s" % ('Updated', docked and " docked" or "!docked", updated and " updated" or "!updated")
|
||||||
|
|
||||||
# Check whether new log file started, e.g. client (re)started.
|
# Check whether new log file started, e.g. client (re)started.
|
||||||
if self.observed:
|
if emitter and emitter.is_alive():
|
||||||
newlogfile = self.logfile # updated by on_created watchdog callback
|
newlogfile = self.logfile # updated by on_created watchdog callback
|
||||||
else:
|
else:
|
||||||
# Poll
|
# Poll
|
||||||
|
Loading…
x
Reference in New Issue
Block a user