fix photo upload: add synchronous /jobs/presign and /jobs/minio-upload endpoints to workers

This commit is contained in:
justin 2026-05-30 19:13:51 -05:00
parent ca7af40ceb
commit e40f359693
2 changed files with 29 additions and 17 deletions

View file

@ -1910,6 +1910,30 @@ class JobHandler(BaseHTTPRequestHandler):
self._handle_rmd_preview()
return
if self.path == "/jobs/presign":
# Synchronous presign — used by API routes
content_length = int(self.headers.get("Content-Length", 0))
body = self.rfile.read(content_length)
try:
payload = json.loads(body)
result = handle_presign(payload)
self._respond(200, result)
except Exception as exc:
self._respond(500, {"error": str(exc)})
return
if self.path == "/jobs/minio-upload":
# Synchronous MinIO upload — used by id-upload
content_length = int(self.headers.get("Content-Length", 0))
body = self.rfile.read(content_length)
try:
payload = json.loads(body)
result = handle_minio_upload(payload)
self._respond(200, result)
except Exception as exc:
self._respond(500, {"error": str(exc)})
return
if self.path != "/jobs":
self._respond(404, {"error": "Not found"})
return