From 0af3734b6f20c6f19be97dd30ee283b6836798c8 Mon Sep 17 00:00:00 2001 From: fogelito Date: Tue, 2 Sep 2025 13:41:10 +0300 Subject: [PATCH] finally unset --- src/Appwrite/Platform/Workers/Audits.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index e8ae2f2168..4f6485efe5 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -131,19 +131,19 @@ class Audits extends Action return new NoCommit(); } - $logs = $this->logs; - $this->logs = []; - - foreach ($logs as $projectLogs) { + foreach ($this->logs as $sequence => $projectLogs) { try { + Console::log('Processing Project "' . $sequence . '" batch with ' . count($projectLogs['logs']) . ' events'); + $projectDocument = $projectLogs['project']; - Console::log('Processing Project "' . $projectDocument->getSequence() . '" batch with ' . count($projectLogs['logs']) . ' events'); $dbForProject = $getProjectDB($projectDocument); $audit = new Audit($dbForProject); $audit->logBatch($projectLogs['logs']); - Console::success('Audit logs processed successfully'); + } catch (Throwable $e) { Console::error('Error processing audit logs for Project "' . $projectDocument->getSequence() . '": ' . $e->getMessage()); + } finally { + unset($this->logs[$sequence]); } }