Merge pull request #11036 from appwrite/functions-skip-subqueiry

Functions skip variables subquery
This commit is contained in:
Shmuel Fogel 2025-12-29 13:08:00 +02:00 committed by GitHub
commit 8a52975048
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,14 +122,16 @@ 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::contains('events', $events),
Query::limit($limit),
Query::offset($offset),
Query::orderAsc('name'),
Query::orderAsc('$sequence'),
]);
$sum = \count($functions);
@ -147,6 +149,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(