diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 966a17808f..d2cb55fe20 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -18,7 +18,7 @@ use Utopia\System\System; class Audits extends Action { - protected const int BATCH_AGGREGATION_INTERVAL = 10000; // in seconds + protected const int BATCH_AGGREGATION_INTERVAL = 60; // in seconds private int $lastTriggeredTime = 0; @@ -73,9 +73,6 @@ class Audits extends Action Console::info('Aggregating audit logs'); - Console::error('project '.$project->getSequence()); - Console::error('lastTriggeredTime '.$this->lastTriggeredTime); - $event = $payload['event'] ?? ''; $auditPayload = ''; @@ -126,25 +123,14 @@ class Audits extends Action // Check if we should process the batch by checking both for the batch size and the elapsed time $batchSize = $this->getBatchSize(); - $batchSize = 3; $logCount = array_reduce($this->logs, fn (int $current, $logs) => $current + count($logs['logs']), 0); $shouldProcessBatch = $logCount >= $batchSize; - var_dump('$logCount'); - var_dump($logCount); - var_dump('$shouldProcessBatch 1'); - var_dump($shouldProcessBatch); - if (!$shouldProcessBatch && $logCount > 0) { $shouldProcessBatch = (\time() - $this->lastTriggeredTime) >= self::BATCH_AGGREGATION_INTERVAL; } - var_dump('$shouldProcessBatch 2'); - var_dump($shouldProcessBatch); - - var_dump($this->logs); - if (!$shouldProcessBatch) { return new NoCommit(); }