mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Remove dbg
This commit is contained in:
parent
dffbe2e4ab
commit
f4caa69840
1 changed files with 1 additions and 15 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue