Merge pull request 'main' (#25) from sangge/mimajingsai:main into main

Reviewed-on: dqy/mimajingsai#25
This commit is contained in:
dqy
2023-10-24 20:16:57 +08:00
5 changed files with 12 additions and 8 deletions

View File

@@ -112,8 +112,8 @@ async def receive_heartbeat_internal():
while 1:
timeout = 7
# 删除超时的节点
# cursor.execute("DELETE FROM nodes WHERE last_heartbeat < ?", (time.time() - timeout,))
# conn.commit()
cursor.execute("DELETE FROM nodes WHERE last_heartbeat < ?", (time.time() - timeout,))
conn.commit()
await asyncio.sleep(timeout)