diff --git a/app/console b/app/console index 3a0c8f0334..9174d8f8cb 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 3a0c8f0334d402a6e27c8b5c0512f3d60080ddbd +Subproject commit 9174d8f8cb584744dd7a53f69d324f490ee82ee3 diff --git a/app/workers/functions.php b/app/workers/functions.php index e5542c9834..beed27018f 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -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,