From c97579ab695f109227e894fb717aa684e8612929 Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Fri, 10 Apr 2026 18:11:43 -0400 Subject: [PATCH] Implement move result code check for recordings (#467) Add error handling for file move operation. --- debian/resources/maintenance/call_recordings.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/resources/maintenance/call_recordings.php b/debian/resources/maintenance/call_recordings.php index 74f860e..b5a1153 100644 --- a/debian/resources/maintenance/call_recordings.php +++ b/debian/resources/maintenance/call_recordings.php @@ -156,7 +156,13 @@ crontab -e if (!file_exists($new_path)) { system('mkdir -p '.$new_path); } $command = "mv ".$old_path."/".$record_name." ".$new_path."/".$record_name; if ($debug) { echo $command."\n"; } - system($command); + system($command, $move_result_code); + + //skip the database update if the move failed + if ($move_result_code !== 0) { + if ($debug) { echo "mv failed with exit code ".$move_result_code.", skipping database update.\n"; } + continue; + } } //update the database to the new directory