diff --git a/plugins/edsm.py b/plugins/edsm.py index a5006a9d..d82c0fc0 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -168,6 +168,7 @@ def plugin_stop() -> None: this.queue.put(None) this.thread.join() this.thread = None + this.session.close() # Suppress 'Exception ignored in: ' errors # TODO: this is bad. this._IMG_KNOWN = this._IMG_UNKNOWN = this._IMG_NEW = this._IMG_ERROR = None logger.debug('Done.') @@ -541,7 +542,6 @@ def worker() -> None: r = this.session.get('https://www.edsm.net/api-journal-v1/discard', timeout=_TIMEOUT) r.raise_for_status() this.discardedEvents = set(r.json()) - r.close() this.discardedEvents.discard('Docked') # should_send() assumes that we send 'Docked' events if not this.discardedEvents: