refactor(storage): relocate logs and sessions
This commit is contained in:
@@ -192,3 +192,4 @@ pip-selfcheck.json
|
|||||||
processed.txt
|
processed.txt
|
||||||
*.log
|
*.log
|
||||||
*.session
|
*.session
|
||||||
|
*/*.session
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if __name__ == "__main__":
|
|||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
|
format="%(asctime)s | %(levelname)s | %(name)s | %(message)s",
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.FileHandler("bot.log", encoding="utf-8"),
|
logging.FileHandler("logs/bot.log", encoding="utf-8"),
|
||||||
logging.StreamHandler(),
|
logging.StreamHandler(),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -237,7 +237,7 @@ class TelegramStarsBot:
|
|||||||
await asyncio.sleep(self.config.check_interval)
|
await asyncio.sleep(self.config.check_interval)
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
is_first_login = not os.path.exists(f"{self.SESSION_NAME}.session")
|
is_first_login = not os.path.exists(f"storage/{self.SESSION_NAME}.session")
|
||||||
|
|
||||||
if is_first_login:
|
if is_first_login:
|
||||||
logger.info("Сессия Telegram не найдена. Запускаю процесс входа...")
|
logger.info("Сессия Telegram не найдена. Запускаю процесс входа...")
|
||||||
|
|||||||
Reference in New Issue
Block a user