dev@locazia: add client_bot & try fix background funcs

This commit is contained in:
user committed 2024-03-06 10:46:11 +03:00
1 parent 27b093bc07
commit f4b77f38e4
10 files changed
+228 -17

No files matched your search

+5
View File
@@ -2,7 +2,9 @@ import asyncio
from contextlib import asynccontextmanager
from datetime import datetime, timedelta
from aiogram import Bot
from app.core.logger import make_log
from app.core._config import TELEGRAM_API_KEY, CLIENT_TELEGRAM_API_KEY
from datetime import datetime
@@ -32,6 +34,9 @@ class Memory:
}
}
self._telegram_bot = Bot(TELEGRAM_API_KEY)
self._client_telegram_bot = Bot(CLIENT_TELEGRAM_API_KEY)
@asynccontextmanager
async def transaction(self, desc=""):
make_log("Memory.transaction", f"Starting transaction; {desc}", level='debug')