MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / ping_server

Function ping_server

TechVJ/utils/keepalive.py:12–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

startFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected