From 9db18cb08d2ee4a3dedc4b70466eb09ab0c28872 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Feb 2024 18:15:28 +0400 Subject: [PATCH] fix ci/cd --- README.md | 2 +- src/__main__.py | 9 ++++----- src/config.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d48605e..46cbb01 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ To host your own instance of the bot, follow these steps: ```dotenv TELEGRAM_BOT_TOKEN=your_telegram_bot_token DEVELOPER_CHAT_ID=your_chat_id_for_getting_logs_and_errors# optional -SQLITE_DB_FILE_PATH=database/db.sqlite# or any other path that you prefer +SQLITE_DB_FILE_PATH=db.sqlite# or any other path that you prefer ``` Please note that you need to create a new bot using the [BotFather](https://t.me/BotFather) and get the token for diff --git a/src/__main__.py b/src/__main__.py index 6a7b8a9..e0f892f 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -17,11 +17,6 @@ from src.db import close_db from src.get_handlers import get_handlers -logging.basicConfig( - format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO -) -logger = logging.getLogger() - def main() -> None: if not config.TELEGRAM_BOT_TOKEN: @@ -38,6 +33,10 @@ def main() -> None: try: main() except Exception: + logging.basicConfig( + format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO + ) + logger = logging.getLogger() logger.warning(traceback.format_exc()) finally: close_db() diff --git a/src/config.py b/src/config.py index fe9ebcd..6325802 100644 --- a/src/config.py +++ b/src/config.py @@ -12,7 +12,7 @@ # Database constants SQLITE_DB_FILE_PATH = os.getenv( - "SQLITE_DB_FILE_PATH", Path().resolve() / "database/db.sqlite" + "SQLITE_DB_FILE_PATH", Path().resolve() / "db.sqlite" ) DATE_FORMAT = "%d.%m.%Y %H:%M:%S"