mirror of
https://github.com/appwrite/appwrite
synced 2026-05-21 16:08:22 +00:00
Try catch inside
This commit is contained in:
parent
ad4e3be80c
commit
bd8d6fdc59
1 changed files with 6 additions and 12 deletions
|
|
@ -134,25 +134,19 @@ class Audits extends Action
|
|||
$logs = $this->logs;
|
||||
$this->logs = [];
|
||||
|
||||
try {
|
||||
foreach ($logs as $projectLogs) {
|
||||
/**
|
||||
* @var $projectDocument Document
|
||||
*/
|
||||
foreach ($logs as $projectLogs) {
|
||||
try {
|
||||
$projectDocument = $projectLogs['project'];
|
||||
|
||||
Console::log('Processing Project "'.$projectDocument->getSequence().'" batch with ' . count($projectLogs['logs']) . ' events');
|
||||
|
||||
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());
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
Console::error('Error processing audit logs: ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->lastTriggeredTime = time();
|
||||
return new Commit();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue