Spaces:
Sleeping
Sleeping
Avinash commited on
Commit ·
b272b04
1
Parent(s): 2e5ad46
fix: proper empty 204 response for jobs/next
Browse files- backend/api.py +2 -2
backend/api.py
CHANGED
|
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
| 6 |
from typing import Any, Dict
|
| 7 |
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
-
from fastapi import FastAPI, HTTPException
|
| 10 |
from fastapi.middleware.cors import CORSMiddleware
|
| 11 |
from fastapi.responses import FileResponse
|
| 12 |
from backend.sftp_store import SFTPStore
|
|
@@ -201,7 +201,7 @@ def jobs_next(x_worker_token: Optional[str] = Header(default=None)):
|
|
| 201 |
if job.status == "queued":
|
| 202 |
job.status = "running"
|
| 203 |
return asdict(job)
|
| 204 |
-
return
|
| 205 |
|
| 206 |
class StatusReq(BaseModel):
|
| 207 |
status: str # running|done|failed
|
|
|
|
| 6 |
from typing import Any, Dict
|
| 7 |
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
+
from fastapi import FastAPI, HTTPException, Response
|
| 10 |
from fastapi.middleware.cors import CORSMiddleware
|
| 11 |
from fastapi.responses import FileResponse
|
| 12 |
from backend.sftp_store import SFTPStore
|
|
|
|
| 201 |
if job.status == "queued":
|
| 202 |
job.status = "running"
|
| 203 |
return asdict(job)
|
| 204 |
+
return Response(status_code=204)
|
| 205 |
|
| 206 |
class StatusReq(BaseModel):
|
| 207 |
status: str # running|done|failed
|