diff --git a/server/broadcast_service.py b/server/broadcast_service.py index f059a6c22..4bdda72cd 100644 --- a/server/broadcast_service.py +++ b/server/broadcast_service.py @@ -29,10 +29,6 @@ def __init__( self.player_service = player_service async def initialize(self): - await self.message_queue_service.declare_exchange( - config.MQ_EXCHANGE_NAME - ) - # Using a lazy interval timer so that the intervals can be changed # without restarting the server. self._broadcast_dirties_timer = LazyIntervalTimer( diff --git a/server/game_service.py b/server/game_service.py index c9ce227b5..cc5e7396f 100644 --- a/server/game_service.py +++ b/server/game_service.py @@ -66,8 +66,6 @@ async def initialize(self) -> None: "*/10 * * * *", func=self.update_data ) - await self._message_queue_service.declare_exchange(config.MQ_EXCHANGE_NAME) - async def initialise_game_counter(self): async with self._db.acquire() as conn: # InnoDB, unusually, doesn't allow insertion of values greater than the next expected diff --git a/server/message_queue_service.py b/server/message_queue_service.py index ab6d7ffe1..cb78de59b 100644 --- a/server/message_queue_service.py +++ b/server/message_queue_service.py @@ -51,6 +51,8 @@ async def initialize(self) -> None: return self._is_ready = True + await self._declare_exchange(config.MQ_EXCHANGE_NAME, ExchangeType.TOPIC) + async def _connect(self) -> None: try: self._connection = await aio_pika.connect_robust(