feat(cli): add Worker and main for TDATA check
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from modules.thread import Worker
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def main():
|
||||
async with Worker() as worker:
|
||||
await worker.check_all()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s | %(levelname)-7s | %(message)s",
|
||||
datefmt="%H:%M:%S",
|
||||
handlers=[logging.StreamHandler()],
|
||||
)
|
||||
|
||||
logging.getLogger("telethon").setLevel(logging.WARNING)
|
||||
logging.getLogger("opentele2").setLevel(logging.WARNING)
|
||||
|
||||
try:
|
||||
asyncio.run(main())
|
||||
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Прервано пользователем")
|
||||
|
||||
except Exception as e:
|
||||
logger.exception(f"Критическая ошибка: {e}")
|
||||
raise
|
||||
Reference in New Issue
Block a user