test: tpem test

This commit is contained in:
sangge 2023-10-24 20:01:56 +08:00
parent 45554c8856
commit f0e16d0a60
3 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ get method
pr pr
docker run --rm -it -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ~/tpre:/app -e HOST_IP=110.41.130.197 git.mamahaha.work/sangge/tpre:base bash docker run --rm -it -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ~/mimajingsai:/app -e HOST_IP=110.41.130.197 git.mamahaha.work/sangge/tpre:base bash
110.41.155.96 tpre1 110.41.155.96 tpre1
110.41.130.197 tpre2 110.41.130.197 tpre2

View File

@ -16,7 +16,7 @@ async def lifespan(app: FastAPI):
app = FastAPI(lifespan=lifespan) app = FastAPI(lifespan=lifespan)
server_address = "http://10.20.14.232:8000/server" server_address = "http://110.41.155.96:8000/server"
id = 0 id = 0
ip = "" ip = ""
client_ip_src = "" # 发送信息用户的ip client_ip_src = "" # 发送信息用户的ip

View File

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