mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-02 08:31:16 +03:00
EDDN: New class as EDDNSender now, and version the queue database file
* It makes more sense for this new class to be concerned with all the 'send it' functionality, not just 'replay', so rename it. * Athough we're trying to get the schema right *first* time, let's plan ahead and version the filename in case of needing to migrations in the future.
This commit is contained in:
parent
424d5f023c
commit
9a660b3b49
@ -125,10 +125,10 @@ HORIZONS_SKU = 'ELITE_HORIZONS_V_PLANETARY_LANDINGS'
|
|||||||
# one.
|
# one.
|
||||||
|
|
||||||
|
|
||||||
class EDDNReplay:
|
class EDDNSender:
|
||||||
"""Store and retry sending of EDDN messages."""
|
"""Store and retry sending of EDDN messages."""
|
||||||
|
|
||||||
SQLITE_DB_FILENAME = 'eddn_replay.db'
|
SQLITE_DB_FILENAME = 'eddn_queue-v1.db'
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""
|
"""
|
||||||
@ -188,6 +188,8 @@ class EDDNReplay:
|
|||||||
of `header`, `$schemaRef` and `message`. Code handling this not being
|
of `header`, `$schemaRef` and `message`. Code handling this not being
|
||||||
the case is only for loading the legacy `replay.json` file messages.
|
the case is only for loading the legacy `replay.json` file messages.
|
||||||
|
|
||||||
|
TODO: Return the unique row id of the added message.
|
||||||
|
|
||||||
:param cmdr: Name of the Commander that created this message.
|
:param cmdr: Name of the Commander that created this message.
|
||||||
:param msg: The full, transmission-ready, EDDN message.
|
:param msg: The full, transmission-ready, EDDN message.
|
||||||
"""
|
"""
|
||||||
@ -267,11 +269,7 @@ class EDDN:
|
|||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
self.session.headers['User-Agent'] = user_agent
|
self.session.headers['User-Agent'] = user_agent
|
||||||
|
|
||||||
#######################################################################
|
self.sender = EDDNSender()
|
||||||
# EDDN delayed sending/retry
|
|
||||||
#######################################################################
|
|
||||||
self.replay = EDDNReplay()
|
|
||||||
#######################################################################
|
|
||||||
|
|
||||||
self.fss_signals: List[Mapping[str, Any]] = []
|
self.fss_signals: List[Mapping[str, Any]] = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user