finally unset

This commit is contained in:
fogelito 2025-09-02 13:41:10 +03:00
parent bd8d6fdc59
commit 0af3734b6f

View file

@ -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]);
}
}