mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
monitor: Handle NavRouteClear & un-() an assert
* Stop trying to load `NavRoute.json` if it contained a `NavRouteClear`. * `assert` is a *keyword*, not a function.
This commit is contained in:
parent
337e7d9272
commit
ddba99bfd8
14
monitor.py
14
monitor.py
@ -1469,7 +1469,7 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
self.state[category].pop(material)
|
self.state[category].pop(material)
|
||||||
|
|
||||||
module = self.state['Modules'][entry['Slot']]
|
module = self.state['Modules'][entry['Slot']]
|
||||||
assert(module['Item'] == self.canonicalise(entry['Module']))
|
assert module['Item'] == self.canonicalise(entry['Module'])
|
||||||
module['Engineering'] = {
|
module['Engineering'] = {
|
||||||
'Engineer': entry['Engineer'],
|
'Engineer': entry['Engineer'],
|
||||||
'EngineerID': entry['EngineerID'],
|
'EngineerID': entry['EngineerID'],
|
||||||
@ -2300,9 +2300,15 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# everything is good, lets set what we need to and make sure we dont try again
|
# Handle it being `NavRouteClear`d already
|
||||||
logger.info('Successfully read NavRoute file for last NavRoute event.')
|
if file['event'].lower() == 'navrouteclear':
|
||||||
self.state['NavRoute'] = file
|
logger.info('NavRoute file contained a NavRouteClear')
|
||||||
|
# We do *NOT* copy into/clear the `self.state['NavRoute']`
|
||||||
|
else:
|
||||||
|
# everything is good, lets set what we need to and make sure we dont try again
|
||||||
|
logger.info('Successfully read NavRoute file for last NavRoute event.')
|
||||||
|
self.state['NavRoute'] = file
|
||||||
|
|
||||||
self._navroute_retries_remaining = 0
|
self._navroute_retries_remaining = 0
|
||||||
self._last_navroute_journal_timestamp = None
|
self._last_navroute_journal_timestamp = None
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user