test: tpem test
This commit is contained in:
@@ -16,7 +16,7 @@ async def lifespan(app: FastAPI):
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
server_address = "http://10.20.14.232:8000/server"
|
||||
server_address = "http://110.41.155.96:8000/server"
|
||||
id = 0
|
||||
ip = ""
|
||||
client_ip_src = "" # 发送信息用户的ip
|
||||
|
@@ -96,8 +96,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)
|
||||
|
||||
@app.get("/server/send_nodes_list")
|
||||
|
Reference in New Issue
Block a user