1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

monitor/NavRoute: Load NavRoute after catching_up ends.

This is to allow restart of EDMarketConnector whilst the game is running
to have `state['NavRoute']` hold data when the synthetic `StartUp` event
is passed to plugins.

NB: Probably need to note this in PLUGINS.md
This commit is contained in:
Athanasius 2022-12-06 15:34:12 +00:00
parent 36f54ba120
commit 25ed649b7a
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -397,6 +397,12 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
except Exception as ex:
logger.debug(f'Invalid journal entry:\n{line!r}\n', exc_info=ex)
# One-shot attempt to read in latest NavRoute, if present
navroute_data = self._parse_navroute_file()
if navroute_data is not None:
# If it's NavRouteClear contents, just keep those anyway.
self.state['NavRoute'] = navroute_data
self.catching_up = False
log_pos = loghandle.tell()