mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +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;
|
$logs = $this->logs;
|
||||||
$this->logs = [];
|
$this->logs = [];
|
||||||
|
|
||||||
try {
|
foreach ($logs as $projectLogs) {
|
||||||
foreach ($logs as $projectLogs) {
|
try {
|
||||||
/**
|
|
||||||
* @var $projectDocument Document
|
|
||||||
*/
|
|
||||||
$projectDocument = $projectLogs['project'];
|
$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);
|
$dbForProject = $getProjectDB($projectDocument);
|
||||||
|
|
||||||
$audit = new Audit($dbForProject);
|
$audit = new Audit($dbForProject);
|
||||||
|
|
||||||
$audit->logBatch($projectLogs['logs']);
|
$audit->logBatch($projectLogs['logs']);
|
||||||
Console::success('Audit logs processed successfully');
|
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();
|
$this->lastTriggeredTime = time();
|
||||||
return new Commit();
|
return new Commit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue