Merge branch '0.16.x' of https://github.com/appwrite/appwrite into matej-qa-3

This commit is contained in:
Christy Jacob
2022-09-13 18:21:44 +00:00
35 changed files with 639 additions and 285 deletions
+1 -1
View File
@@ -360,7 +360,7 @@ App::get('/v1/avatars/initials')
->action(function (string $name, int $width, int $height, string $background, Response $response, Document $user) {
$themes = [
['background' => '#F2F2F8'], // Default
['background' => '#FFA1CE'], // Default (Pink)
['background' => '#FDC584'], // Orange
['background' => '#94DBD1'], // Green
['background' => '#A1C4FF'], // Blue
+4 -4
View File
@@ -1008,7 +1008,7 @@ App::post('/v1/functions/:functionId/executions')
'statusCode' => 0,
'response' => '',
'stderr' => '',
'time' => 0.0,
'duration' => 0.0,
'search' => implode(' ', [$functionId, $executionId]),
])));
@@ -1095,11 +1095,11 @@ App::post('/v1/functions/:functionId/executions')
$execution->setAttribute('response', $executionResponse['response']);
$execution->setAttribute('stdout', $executionResponse['stdout']);
$execution->setAttribute('stderr', $executionResponse['stderr']);
$execution->setAttribute('time', $executionResponse['time']);
$execution->setAttribute('duration', $executionResponse['duration']);
} catch (\Throwable $th) {
$interval = (new \DateTime())->diff(new \DateTime($execution->getCreatedAt()));
$execution
->setAttribute('time', (float)$interval->format('%s.%f'))
->setAttribute('duration', (float)$interval->format('%s.%f'))
->setAttribute('status', 'failed')
->setAttribute('statusCode', $th->getCode())
->setAttribute('stderr', $th->getMessage());
@@ -1113,7 +1113,7 @@ App::post('/v1/functions/:functionId/executions')
->setParam('functionId', $function->getId())
->setParam('executions.{scope}.compute', 1)
->setParam('executionStatus', $execution->getAttribute('status', ''))
->setParam('executionTime', $execution->getAttribute('time')); // ms
->setParam('executionTime', $execution->getAttribute('duration')); // ms
$roles = Authorization::getRoles();
$isPrivilegedUser = Auth::isPrivilegedUser($roles);