MCPcopy Create free account
hub / github.com/HiddenCodeDevs/BlumTelegramBot / run_tasks

Function run_tasks

bot/utils/launcher.py:72–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 return tg_clients
71
72async def run_tasks():
73 tg_clients = get_tg_clients()
74 proxies = get_proxies()
75 proxies_cycle = cycle(proxies) if proxies else None
76 loop = asyncio.get_event_loop()
77
78 if settings.USE_CUSTOM_PAYLOAD_SERVER and not await check_payload_server(settings.CUSTOM_PAYLOAD_SERVER_URL, full_test=True):
79 logger.warning(
80 f"The payload server on {settings.CUSTOM_PAYLOAD_SERVER_URL} is unavailable or not running. "
81 f"<y>Without it, the bot will not play games for passes.</y> \n"
82 f"<r>Read info</r>: https://github.com/HiddenCodeDevs/BlumTelegramBot/blob/main/PAYLOAD-SERVER.MD"
83 )
84
85 tasks = [
86 loop.create_task(
87 run_tapper(
88 tg_client=tg_client,
89 proxy=next(proxies_cycle) if proxies_cycle else None
90 )
91 )
92 for tg_client in tg_clients
93 ]
94
95 await asyncio.gather(*tasks)

Callers

nothing calls this directly

Calls 4

check_payload_serverFunction · 0.90
run_tapperFunction · 0.90
get_tg_clientsFunction · 0.85
get_proxiesFunction · 0.85

Tested by

no test coverage detected