Create execution even when logging is disabled
This commit is contained in:
parent
e5fd3619f7
commit
66c761b73e
2 changed files with 8 additions and 17 deletions
|
@ -1702,6 +1702,7 @@ App::post('/v1/functions/:functionId/executions')
|
|||
}
|
||||
|
||||
$executionId = ID::unique();
|
||||
var_dump("creating execution document");
|
||||
|
||||
$execution = new Document([
|
||||
'$id' => $executionId,
|
||||
|
@ -1729,10 +1730,7 @@ App::post('/v1/functions/:functionId/executions')
|
|||
->setContext('function', $function);
|
||||
|
||||
if ($async) {
|
||||
if ($function->getAttribute('logging')) {
|
||||
/** @var Document $execution */
|
||||
$execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution));
|
||||
}
|
||||
$execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution));
|
||||
|
||||
$queueForFunctions
|
||||
->setType('http')
|
||||
|
@ -1850,10 +1848,7 @@ App::post('/v1/functions/:functionId/executions')
|
|||
;
|
||||
}
|
||||
|
||||
if ($function->getAttribute('logging')) {
|
||||
/** @var Document $execution */
|
||||
$execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution));
|
||||
}
|
||||
$execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution));
|
||||
|
||||
$roles = Authorization::getRoles();
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser($roles);
|
||||
|
|
|
@ -328,9 +328,7 @@ class Functions extends Action
|
|||
'search' => implode(' ', [$functionId, $executionId]),
|
||||
]);
|
||||
|
||||
if ($function->getAttribute('logging')) {
|
||||
$execution = $dbForProject->createDocument('executions', $execution);
|
||||
}
|
||||
$execution = $dbForProject->createDocument('executions', $execution);
|
||||
|
||||
// TODO: @Meldiron Trigger executions.create event here
|
||||
|
||||
|
@ -342,9 +340,7 @@ class Functions extends Action
|
|||
if ($execution->getAttribute('status') !== 'processing') {
|
||||
$execution->setAttribute('status', 'processing');
|
||||
|
||||
if ($function->getAttribute('logging')) {
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
}
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
}
|
||||
|
||||
$durationStart = \microtime(true);
|
||||
|
@ -455,9 +451,9 @@ class Functions extends Action
|
|||
;
|
||||
}
|
||||
|
||||
if ($function->getAttribute('logging')) {
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
}
|
||||
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
|
||||
/** Trigger Webhook */
|
||||
$executionModel = new Execution();
|
||||
$queueForEvents
|
||||
|
|
Loading…
Reference in a new issue