From 2914cbee618fd609ac02cd10d64a2026ddd3c18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?k=C3=A4x?= Date: Mon, 30 Mar 2026 15:12:09 +0700 Subject: [PATCH] added upload timed out in google lens sciprt --- scripts/google_lens.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/google_lens.sh b/scripts/google_lens.sh index 4e1dee2d..a34bcb82 100755 --- a/scripts/google_lens.sh +++ b/scripts/google_lens.sh @@ -36,10 +36,14 @@ echo "Uploading image to uguu.se..." >&2 # Temporarily disable set -e to handle curl errors gracefully set +e -uploadResponse=$(curl -sS -f -F "files[]=@$IMAGE_PATH" 'https://uguu.se/upload' 2>&1) +uploadResponse=$(curl -sS -f --connect-timeout 10 --max-time 30 -F "files[]=@$IMAGE_PATH" 'https://uguu.se/upload' 2>&1) curlExit=$? set -e +if [[ $curlExit -eq 28 ]]; then + notify-send -u critical "Google Lens" "Upload timed out" + echo "ERROR: Upload timed out after 30 seconds" >&2 + exit 1 if [[ $curlExit -ne 0 ]]; then notify-send -u critical "Google Lens" "Upload failed (curl error $curlExit)" >&2 echo "ERROR: Upload failed with curl exit code $curlExit" >&2