Showing 1 changed files with 7 additions and 5 deletions
+7 -5
garmin_varia_transcode.sh
@@ -1897,13 +1897,15 @@ process_video_file() {
1897 1897
   OUTPUT_BYTES_PROCESSED=$((OUTPUT_BYTES_PROCESSED + output_size_bytes))
1898 1898
 
1899 1899
   if [[ "$MOVE_SOURCE" == true ]]; then
1900
-    if rm -f "$input_file"; then
1900
+    if timeout 5s rm -f "$input_file" 2>/dev/null; then
1901 1901
       vlog_msg "INFO" "Removed source after successful validation: $input_file"
1902 1902
     else
1903
-      ERRORS=$((ERRORS + 1))
1904
-      log_msg "ERROR" "Failed to remove source after validation: $input_file"
1905
-      cleanup_process_inputs "$staged_input_file" "$repacked_input_file"
1906
-      return 1
1903
+      local rm_rc=$?
1904
+      if [[ $rm_rc -eq 124 ]]; then
1905
+        log_msg "WARN" "Source file removal timed out (NFS unresponsive?): $input_file"
1906
+      else
1907
+        log_msg "WARN" "Could not remove source file: $input_file"
1908
+      fi
1907 1909
     fi
1908 1910
   fi
1909 1911