Merge branch 'main' of https://git.mamahaha.work/sangge/mimajingsai
This commit is contained in:
commit
9bfe0dfd42
@ -7,7 +7,7 @@ get method
|
||||
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
|
||||
|
||||
|
||||
tpre3: docker run --rm -it -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ~/mimajingsai:/app -e HOST_IP=110.41.21.35 git.mamahaha.work/sangge/tpre:base bash
|
||||
|
@ -311,8 +311,8 @@ async def recieve_request(i_m: IP_Message):
|
||||
|
||||
|
||||
def get_own_ip() -> str:
|
||||
hostname = socket.gethostname()
|
||||
ip = socket.gethostbyname(hostname)
|
||||
|
||||
ip = os.environ.get("HOST_IP", "IP not set")
|
||||
return 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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user