Refine
This commit is contained in:
11
main.py
11
main.py
@@ -121,13 +121,20 @@ async def fastapi_is_locked_by_me(network: str, req: Request):
|
||||
client_host = req.client.host
|
||||
return lockedPrjs.get(network) == client_host
|
||||
|
||||
# 0 successfully locked
|
||||
# 1 already locked by you
|
||||
# 2 locked by others
|
||||
@app.post("/lockproject/")
|
||||
async def fastapi_lock_project(network: str, req: Request):
|
||||
client_host = req.client.host
|
||||
if not network in lockedPrjs.keys():
|
||||
lockedPrjs[network] = client_host
|
||||
return client_host
|
||||
return ""
|
||||
return 0
|
||||
else:
|
||||
if lockedPrjs.get(network) == client_host:
|
||||
return 1
|
||||
else:
|
||||
return 2
|
||||
|
||||
@app.post("/unlockproject/")
|
||||
async def fastapi_unlock_project(network: str, req: Request):
|
||||
|
||||
Reference in New Issue
Block a user