1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Add functions.executions.update

This commit is contained in:
kodumbeats 2021-03-12 13:28:29 -05:00
parent f734fc1de2
commit 731c87d740
2 changed files with 27 additions and 0 deletions

View file

@ -132,6 +132,11 @@ return [
'model' => Response::MODEL_EXECUTION,
'note' => 'version >= 0.7',
],
'functions.executions.update' => [
'description' => 'This event triggers when a function execution is updated.',
'model' => Response::MODEL_EXECUTION,
'note' => 'version >= 0.7',
],
'storage.files.create' => [
'description' => 'This event triggers when a storage file is created.',
'model' => Response::MODEL_FILE,

View file

@ -469,6 +469,28 @@ class FunctionsV1
throw new Exception('Failed saving execution to DB', 500);
}
var_dump($execution);
$executionUpdate = new Event('v1-webhooks', 'WebhooksV1');
$executionUpdate
->setParam('projectId', $projectId)
->setParam('userId', '')
->setParam('event', 'functions.executions.update')
->setParam('payload', [
'$id' => $execution['$id'],
'functionId' => $execution['functionId'],
'dateCreated' => $execution['dateCreated'],
'trigger' => $execution['trigger'],
'status' => $execution['status'],
'exitCode' => $execution['exitCode'],
'stdout' => $execution['stdout'],
'stderr' => $execution['stderr'],
'time' => $execution['time']
]);
$executionUpdate->trigger();
$usage = new Event('v1-usage', 'UsageV1');
$usage