Add timing to L1 request for debugging
Log how long requests.get() actually takes to identify network delays. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1788,9 +1788,12 @@ async def record_run(req: RecordRunRequest, user: User = Depends(get_required_us
|
|||||||
|
|
||||||
# Helper to fetch from L1 without blocking event loop
|
# Helper to fetch from L1 without blocking event loop
|
||||||
def fetch_l1_run():
|
def fetch_l1_run():
|
||||||
|
import time as _time
|
||||||
url = f"{l1_url}/runs/{req.run_id}"
|
url = f"{l1_url}/runs/{req.run_id}"
|
||||||
logger.info(f"record_run: Fetching run from L1: {url}")
|
logger.info(f"record_run: Fetching run from L1: {url}")
|
||||||
|
t0 = _time.time()
|
||||||
resp = requests.get(url, timeout=30)
|
resp = requests.get(url, timeout=30)
|
||||||
|
logger.info(f"record_run: L1 request took {_time.time()-t0:.3f}s, status={resp.status_code}")
|
||||||
if resp.status_code == 404:
|
if resp.status_code == 404:
|
||||||
raise ValueError(f"Run not found on L1: {req.run_id}")
|
raise ValueError(f"Run not found on L1: {req.run_id}")
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
|
|||||||
Reference in New Issue
Block a user