Do not fail whole app when ESI access object fails instantiation

This commit is contained in:
DarkPhoenix
2025-12-10 19:22:52 +01:00
parent 17f9071317
commit 56bb8217d3

13
pyfa.py
View File

@@ -151,10 +151,15 @@ if __name__ == "__main__":
ErrorHandler.SetParent(mf)
# Start ESI token validation, this helps avoid token expiry
from service.esi import Esi
esi = Esi.getInstance()
esi.startTokenValidation()
pyfalog.info("ESI token validation started")
try:
from service.esi import Esi
esi = Esi.getInstance()
esi.startTokenValidation()
pyfalog.info("ESI token validation started")
except (KeyboardInterrupt, SystemExit):
raise
except Exception as e:
pyfalog.warning(f"failed to start ESI token validation thread:\n{e}")
if options.profile_path:
profile_path = os.path.join(options.profile_path, 'pyfa-{}.profile'.format(datetime.datetime.now().strftime('%Y%m%d_%H%M%S')))