1
0
Fork 0
mirror of synced 2024-10-03 02:37:40 +13:00

feat: remove unused orderBy, skip executing recursive functions

This commit is contained in:
Christy Jacob 2023-06-02 17:19:00 +05:30
parent 2ee7a3a356
commit 23e6c1adf6
2 changed files with 11 additions and 4 deletions

@ -1 +1 @@
Subproject commit 3a0c8f0334d402a6e27c8b5c0512f3d60080ddbd
Subproject commit 9174d8f8cb584744dd7a53f69d324f490ee82ee3

View file

@ -265,8 +265,7 @@ $server->job()
while ($sum >= $limit) {
$functions = $dbForProject->find('functions', [
Query::limit($limit),
Query::offset($offset),
Query::orderAsc('name'),
Query::offset($offset)
]);
$sum = \count($functions);
@ -278,7 +277,15 @@ $server->job()
if (!array_intersect($events, $function->getAttribute('events', []))) {
continue;
}
Console::success('Iterating function: ' . $function->getAttribute('name'));
/** Skip if a function has been triggered by its own execution */
$event = "functions.{$function->getId()}.executions.*";
if(in_array($event, $events)) {
Console::warning("Skipping function: {$function->getAttribute('name')} from project: {$project->getId()} triggered by self");
continue;
}
Console::success("Iterating function: {$function->getAttribute('name')} from project: {$project->getId()}");
$execute(
log: $log,
statsd: $statsd,