From 87311797f2ece141467966599175cc3ef5313e58 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 30 Aug 2021 15:23:11 +0545 Subject: [PATCH] more comments --- app/tasks/usage.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/tasks/usage.php b/app/tasks/usage.php index 3fa90a3f4..e66bec113 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -310,17 +310,14 @@ $cli } /** - * Aggregate MariaDB every 15 minutes - * Some of the queries here might contain full-table scans. - */ - if ($iterations % 30 == 0) { // Every 15 minutes - // Aggregate number of objects in database - // Get count of all the documents per collection - - // Buckets will have the same + * Aggregate MariaDB every 15 minutes + * Some of the queries here might contain full-table scans. + */ + if ($iterations % 30 == 0) { // Every 15 minutes aggregate number of objects in database $latestProject = null; - do { + do { // Loop over all the projects $projects = $dbForConsole->find('projects', [], 100, orderAfter:$latestProject); if (empty($projects)) { @@ -440,7 +437,7 @@ $cli $latestParent = null; $subCollectionCounts = []; //total project level count of sub collections - do { + do { // Loop over all the parent collection document for each sub collection $dbForProject->setNamespace("project_{$projectId}_{$options['namespace']}"); $parents = $dbForProject->find($collection, [], 100, orderAfter:$latestParent); // Get all the parents for the sub collections for example for documents, this will get all the collections