diff --git a/server/config.py b/server/config.py index 6fe1af35e..26b2250a1 100644 --- a/server/config.py +++ b/server/config.py @@ -56,6 +56,7 @@ def __init__(self): self.MQ_SERVER = "127.0.0.1" self.MQ_PORT = 5672 self.MQ_VHOST = "/faf-lobby" + self.MQ_EXCHANGE_NAME = "faf-rabbitmq" self.WWW_URL = "https://www.faforever.com" self.CONTENT_URL = "http://content.faforever.com" diff --git a/server/game_service.py b/server/game_service.py index f02e41b5a..f24e63564 100644 --- a/server/game_service.py +++ b/server/game_service.py @@ -3,6 +3,8 @@ import aiocron +from server.config import config + from . import metrics from .core import Service from .db import FAFDatabase @@ -60,7 +62,7 @@ async def initialize(self) -> None: "*/10 * * * *", func=self.update_data ) - await self._message_queue_service.declare_exchange("faf-rabbitmq") + await self._message_queue_service.declare_exchange(config.MQ_EXCHANGE_NAME) async def initialise_game_counter(self): async with self._db.acquire() as conn: @@ -227,7 +229,7 @@ def __contains__(self, item): async def publish_game_results(self, game_results: EndedGameInfo): result_dict = game_results.to_dict() await self._message_queue_service.publish( - "faf-rabbitmq", + config.MQ_EXCHANGE_NAME, "success.gameResults.create", result_dict, )