From 1fcd4ca1e8a48fc40b768505052563dc05805730 Mon Sep 17 00:00:00 2001 From: Noah Sprent Date: Wed, 3 Jun 2026 13:39:15 +0100 Subject: [PATCH] Remove stale upload_to_gcs call from /api/capture handler GCS uploads were moved out of the plugin into the cron sidecar (~/take_and_upload_photo.sh) in 1652eec, but the matching import and call in camera_server.py were left behind. First POST to /api/capture raised ImportError, dropping the connection mid-response and surfacing in the UI as Capture failed: network error. --- pioreactor_camera/camera_server.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/pioreactor_camera/camera_server.py b/pioreactor_camera/camera_server.py index f636944..865d8c5 100644 --- a/pioreactor_camera/camera_server.py +++ b/pioreactor_camera/camera_server.py @@ -133,23 +133,10 @@ def do_POST(self): path = parsed.path.rstrip("/") if path == "/api/capture": - from pioreactor_camera.camera_capture import capture_image, upload_to_gcs, IMAGE_DIR as CAP_DIR + from pioreactor_camera.camera_capture import capture_image, IMAGE_DIR as CAP_DIR filename = capture_image(CAP_DIR) if filename: - # Optionally upload to GCS - try: - upload_gcs = config.getboolean("camera_capture.config", "upload_to_gcs", fallback=True) - if upload_gcs: - gcs_bucket = config.get( - "camera_capture.config", "gcs_bucket", - fallback="gs://pioreactor-webcam-snaps-1768947561/webcam_snaps" - ) - gcs_project = config.get( - "camera_capture.config", "gcs_project", fallback="changebio-tech" - ) - upload_to_gcs(CAP_DIR / filename, gcs_bucket, gcs_project) - except Exception: - pass + # GCS upload handled by separate cron (~/take_and_upload_photo.sh) ts = parse_image_timestamp(filename) self._json_response({ "success": True,