Skip to content

Commit

Permalink
Fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickBaus committed Jan 21, 2025
1 parent e6ff716 commit 003a9d7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def __connect(self):
while "database not connected":
if connection_attempt == 1:
self.__logger.info(
"Worker (MongoD): Connecting to database (%s).",
"Worker (MongoDB): Connecting to database (%s).",
self.hostname,
)
self.__client = motor.motor_asyncio.AsyncIOMotorClient(
Expand All @@ -99,14 +99,14 @@ async def __connect(self):
],
)
self.__logger.info(
"Worker (MongoD): Successfully connected to database (%s).",
"Worker (MongoDB): Successfully connected to database (%s).",
self.hostname,
)
except pymongo.errors.AutoReconnect as exc:
if connection_attempt == 1:
# Only log the error once
self.__logger.error(
"Worker (MongoD): Cannot connect to config database at %s. Error: %s. Retrying in %f s.",
"Worker (MongoDB): Cannot connect to config database at %s. Error: %s. Retrying in %f s.",
self.hostname,
exc,
timeout,
Expand Down Expand Up @@ -159,23 +159,23 @@ def _log_database_error(
database_name = str(database_model) if database_name is None else database_name

if error_code is None:
self.__logger.info("Worker(%s database): Successfully connected.", database_name)
self.__logger.info("Worker (%s database): Successfully connected.", database_name)
elif error_code == -2:
self.__logger.error("Worker(%s database): Failure in name resolution. Retrying.", database_name)
self.__logger.error("Worker (%s database): Failure in name resolution. Retrying.", database_name)
elif error_code == 104:
self.__logger.error("Worker(%s database): Database disconnected. Waiting to restart.", database_name)
self.__logger.error("Worker (%s database): Database disconnected. Waiting to restart.", database_name)
elif error_code == 111:
self.__logger.error("Worker(%s database): Connection refused. Waiting to start.", database_name)
self.__logger.error("Worker (%s database): Connection refused. Waiting to start.", database_name)
elif error_code == 211:
self.__logger.error("Worker(%s database): Initialising replica set. Waiting to start.", database_name)
self.__logger.error("Worker (%s database): Initialising replica set. Waiting to start.", database_name)
elif error_code == "resume_token":
self.__logger.error(
"Worker(%s database): Cannot resume Mongo DB change stream, there is no token. Starting from scratch.",
"Worker (%s database): Cannot resume Mongo DB change stream, there is no token. Starting from scratch.",
database_name,
)
else:
self.__logger.error(
"Worker(%s database): Connection error while monitoring database. Error: %s. Reconnecting in %.2f s.",
"Worker (%s database): Connection error while monitoring database. Error: %s. Reconnecting in %.2f s.",
database_name,
error_code,
timeout,
Expand Down

0 comments on commit 003a9d7

Please sign in to comment.