1
0
Fork 0
mirror of synced 2024-06-15 09:14:50 +12:00

Rebuild Specs, SDKs and start working on subqueries

This commit is contained in:
Bradley Schofield 2022-08-12 16:51:24 +01:00
parent 26fad5e8fe
commit cb87c248d5
9 changed files with 19 additions and 9 deletions

View file

@ -1940,7 +1940,7 @@ $collections = [
'$id' => 'vars',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 16384,
'size' => 1000000,
'signed' => true,
'required' => false,
'default' => null,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -77,6 +77,7 @@ App::post('/v1/functions')
'scheduleNext' => 0,
'timeout' => $timeout,
'search' => implode(' ', [$functionId, $name, $runtime]),
'vars' => []
]));
$eventsInstance->setParam('functionId', $function->getId());
@ -320,6 +321,8 @@ App::put('/v1/functions/:functionId')
'search' => implode(' ', [$functionId, $name, $function->getAttribute('runtime')]),
])));
$dbForProject->deleteCachedDocument('functions', $function->getId());
if ($next && $schedule !== $original) {
// Async task reschedule
$functionEvent = new Func();
@ -386,6 +389,8 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId')
'scheduleNext' => (int)$next,
])));
$dbForProject->deleteCachedDocument('functions', $function->getId());
if ($next) { // Init first schedule
$functionEvent = new Func();
$functionEvent
@ -767,6 +772,8 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId')
])));
}
$dbForProject->deleteCachedDocument('functions', $function->getId());
$usage
->setParam('storage', $deployment->getAttribute('size', 0) * -1);

View file

@ -188,6 +188,7 @@ class BuildsV1 extends Worker
if ($deployment->getAttribute('activate') === true) {
$function->setAttribute('deployment', $deployment->getId());
$function = $dbForProject->updateDocument('functions', $function->getId(), $function);
$dbForProject->deleteCachedDocument('functions', $function->getId());
}
/** Update function schedule */
@ -196,6 +197,7 @@ class BuildsV1 extends Worker
$next = (empty($function->getAttribute('deployment')) && !empty($schedule)) ? $cron->getNextRunDate()->format('U') : 0;
$function->setAttribute('scheduleNext', (int)$next);
$function = $dbForProject->updateDocument('functions', $function->getId(), $function);
$dbForProject->deleteCachedDocument('functions', $function->getId());
} catch (\Throwable $th) {
$endtime = \time();
$build->setAttribute('endTime', $endtime);

View file

@ -245,7 +245,7 @@ class Response extends SwooleResponse
->setModel(new BaseList('Currencies List', self::MODEL_CURRENCY_LIST, 'currencies', self::MODEL_CURRENCY))
->setModel(new BaseList('Phones List', self::MODEL_PHONE_LIST, 'phones', self::MODEL_PHONE))
->setModel(new BaseList('Metric List', self::MODEL_METRIC_LIST, 'metrics', self::MODEL_METRIC, true, false))
->setModel(new BaseList('Variables List', self::MODEL_VARIABLE_LIST, 'variables', self::MODEL_VARIABLE, true, false))
->setModel(new BaseList('Variables List', self::MODEL_VARIABLE_LIST, 'variables', self::MODEL_VARIABLE))
// Entities
->setModel(new Database())
->setModel(new Collection())

View file

@ -62,10 +62,11 @@ class Func extends Model
'example' => '5e5ea5c16897e',
])
->addRule('vars', [
'type' => self::TYPE_JSON,
'type' => Response::MODEL_VARIABLE,
'description' => 'Function environment variables.',
'default' => new \stdClass(),
'example' => ['key' => 'value'],
'default' => [],
'example' => new \stdClass(),
'array' => true
])
->addRule('events', [
'type' => self::TYPE_STRING,