QA bug fixing
This commit is contained in:
parent
d0df9408af
commit
056ea0820e
2 changed files with 13 additions and 4 deletions
|
@ -145,6 +145,11 @@ Server::setResource('execute', function () {
|
|||
'APPWRITE_FUNCTION_JWT' => $jwt ?? '',
|
||||
]);
|
||||
|
||||
$body = $vars['APPWRITE_FUNCTION_EVENT_DATA'] ?? '';
|
||||
if(empty($body)) {
|
||||
$body = $vars['APPWRITE_FUNCTION_DATA'] ?? '';
|
||||
}
|
||||
|
||||
/** Execute function */
|
||||
try {
|
||||
$client = new Executor(App::getEnv('_APP_EXECUTOR_HOST'));
|
||||
|
@ -152,7 +157,7 @@ Server::setResource('execute', function () {
|
|||
projectId: $project->getId(),
|
||||
deploymentId: $deploymentId,
|
||||
version: $function->getAttribute('version'),
|
||||
body: $vars['APPWRITE_FUNCTION_DATA'] ?? '',
|
||||
body: $body,
|
||||
variables: $vars,
|
||||
timeout: $function->getAttribute('timeout', 0),
|
||||
image: $runtime['image'],
|
||||
|
@ -311,9 +316,11 @@ $server->job()
|
|||
data: null,
|
||||
executionId: null,
|
||||
jwt: null,
|
||||
path: $payload['path'],
|
||||
method: $payload['method'],
|
||||
headers: $payload['headers'],
|
||||
path: '/',
|
||||
method: 'POST',
|
||||
headers: [
|
||||
'user-agent' => 'Appwrite/' . APP_VERSION_STABLE
|
||||
],
|
||||
);
|
||||
Console::success('Triggered function: ' . $events[0]);
|
||||
}
|
||||
|
|
|
@ -130,6 +130,8 @@ class Executor
|
|||
string $method,
|
||||
array $headers,
|
||||
) {
|
||||
$headers['host'] = App::getEnv('_APP_DOMAIN', '');
|
||||
|
||||
$runtimeId = "$projectId-$deploymentId";
|
||||
$route = '/runtimes/' . $runtimeId . '/execution';
|
||||
$params = [
|
||||
|
|
Loading…
Reference in a new issue