Compare commits

...
2 changed files with 19 additions and 6 deletions
+1 -1
View File
@@ -951,7 +951,7 @@ services:
hostname: exc1
<<: *x-logging
stop_signal: SIGINT
image: openruntimes/executor:0.7.14
image: openruntimes/executor:0.7.15-streaming-1
restart: unless-stopped
networks:
- appwrite
+18 -5
View File
@@ -97,15 +97,28 @@ class Executor
];
$endpoint = $this->selectEndpoint($projectId, $deploymentId);
$response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout);
$status = $response['headers']['status-code'];
$response = '';
$this->call(
$endpoint,
self::METHOD_POST,
$route,
['x-opr-runtime-id' => $runtimeId],
$params,
true,
$timeout,
callback: function ($chunk) use (&$response) {
$response .= $chunk;
}
);
$response = json_decode($response, true);
$status = $response['code'] ?? 201;
if ($status >= 400) {
$message = \is_string($response['body']) ? $response['body'] : $response['body']['message'];
throw new \Exception($message, $status);
throw new \Exception($response['message'], $status);
}
return $response['body'];
return $response;
}
/**