GUI Login bug: seemed to be a problem when using the login call from GUI where it would timeout if taking too long. Did not resolve why but found using await run_in_threadpool and upping the timeout solved the symptom. Maybe changes to baton ahve ebcome very itnesive seerver side... should monitor.
This commit is contained in:
@@ -151,7 +151,7 @@ daq.set_face_detection_progress_callback(_push_face_detection_progress)
|
||||
|
||||
@app.post("/token")
|
||||
async def login(form_data: OAuth2PasswordRequestForm = Depends()):
|
||||
data = auth.authenticate_user(cfg, form_data)
|
||||
data = await run_in_threadpool(auth.authenticate_user, cfg, form_data)
|
||||
return {"access_token": data, "token_type": "bearer"}
|
||||
|
||||
@app.get("/meta/error-codes")
|
||||
|
||||
@@ -28,7 +28,7 @@ def auth(base_url: str | None) -> str:
|
||||
headers={
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
timeout=(2.0, 5.0), # (connect timeout, read timeout)
|
||||
timeout=(3.0, 15.0), # (connect timeout, read timeout)
|
||||
)
|
||||
except requests.RequestException as e:
|
||||
logger.error(f"Authentication request failed (network): {e}")
|
||||
|
||||
Reference in New Issue
Block a user