1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-22 20:00:29 +03:00

dashboard: Bail early from process() if in shutdown

This commit is contained in:
Athanasius 2021-01-11 16:41:36 +00:00
parent 50f520ab66
commit cb9bd30a05

View File

@ -115,6 +115,9 @@ class Dashboard(FileSystemEventHandler):
# Can be called either in watchdog thread or, if polling, in main thread.
def process(self, logfile=None):
if config.shutting_down():
return
try:
with open(join(self.currentdir, 'Status.json'), 'rb') as h:
data = h.read().strip()
@ -126,6 +129,7 @@ class Dashboard(FileSystemEventHandler):
self.status != entry):
self.status = entry
self.root.event_generate('<<DashboardEvent>>', when="tail")
except Exception:
logger.exception('Reading Status.json')