From 4a217c52973c11b3d52d096a7614ef6c0a6aa8e7 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Feb 2024 19:01:34 +0400 Subject: [PATCH] quick fix (#9) --- docker-compose.yaml | 6 +++--- src/services/db_service.py | 11 ----------- 2 files changed, 3 insertions(+), 14 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: 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: