From 774e3af61c1f333da8079beb5a5f862f7fac5d9c Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 29 Dec 2025 10:20:32 +0200 Subject: [PATCH] skip variables subquery --- src/Appwrite/Platform/Workers/Functions.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index d962ddc8a8..8211a46bd5 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -122,14 +122,15 @@ class Functions extends Action $log->addTag('type', $type); if (!empty($events)) { - $limit = 30; - $sum = 30; + $limit = 100; + $sum = 100; $offset = 0; while ($sum >= $limit) { $functions = $dbForProject->find('functions', [ + Query::select(['$id', 'events']), // Skip variables subqueries Query::limit($limit), Query::offset($offset), - Query::orderAsc('name'), + Query::orderAsc('$sequence'), ]); $sum = \count($functions); @@ -147,6 +148,11 @@ class Functions extends Action continue; } + /** + * get variables subqueries cached + */ + $function = $dbForProject->getDocument('functions', $function->getId()); + Console::success('Iterating function: ' . $function->getAttribute('name')); $this->execute(