MCPcopy Create free account
hub / github.com/TechifyBots/File-Stream-Bot / ping_server

Function ping_server

biisal/utils/keepalive.py:8–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8async def ping_server():
9 sleep_time = Var.PING_INTERVAL
10 while True:
11 await asyncio.sleep(sleep_time)
12 try:
13 async with aiohttp.ClientSession(
14 timeout=aiohttp.ClientTimeout(total=10)
15 ) as session:
16 async with session.get(Var.URL) as resp:
17 logging.info("Pinged server with response: {}".format(resp.status))
18 except TimeoutError:
19 logging.warning("Couldn't connect to the site URL..!")
20 except Exception:
21 traceback.print_exc()

Callers 1

start_servicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected