From d6e7e3c8d519d8054985ce2e22b117c6c97379e6 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Feb 2024 17:57:43 +0400 Subject: [PATCH 1/2] fix --- src/services/db_service.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/services/db_service.py b/src/services/db_service.py index 9e00b17..5d9a422 100644 --- a/src/services/db_service.py +++ b/src/services/db_service.py @@ -44,17 +44,6 @@ async def save_playroom(playroom: Playroom) -> None: logging.info(f"Playroom {playroom.name} already exists in the database") -async def save_playroom(playroom: Playroom) -> None: - """Add a game room to the bot_data""" - try: - await execute( - "INSERT INTO playrooms (id, name) VALUES (?, ?)", - (playroom.telegram_chat_id, playroom.name), - ) - except sqlite3.IntegrityError: - logging.info(f"Playroom {playroom.name} already exists in the database") - - async def save_player(player: Player) -> None: """Add a player to the bot_data""" try: From 8d60c6654f4ee3fc1a5146292c32c78871a868fc Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Feb 2024 18:56:38 +0400 Subject: [PATCH 2/2] fix --- docker-compose.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0432d1f..7bbe575 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: bot: build: . environment: - - SQLITE_DB_FILE_PATH=${SQLITE_DB_FILE_PATH} + - SQLITE_DB_FILE_PATH=/database/db.sqlite - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN} - DEVELOPER_CHAT_ID=${DEVELOPER_CHAT_ID} volumes: @@ -12,8 +12,8 @@ services: entrypoint: ["/bin/sh", "-c"] command: - | - python -m sqlite3 ${SQLITE_DB_FILE_PATH} < src/sql/init.sql - python src/__main__.py + python -m sqlite3 ${SQLITE_DB_FILE_PATH} < src/sql/init.sql; + python src/__main__.py; restart: always sqlitebrowser: