Merge pull request #3348 from appwrite/fix-first-execution-delay

Fix: Unnecessary execution delays
This commit is contained in:
Torsten Dittmann 2022-06-09 21:12:41 +02:00 committed by GitHub
commit a9a00d76ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,10 +186,18 @@ class Executor
);
$response = $this->call(self::METHOD_POST, $route, $headers, $params, true, $requestTimeout);
$status = $response['headers']['status-code'];
if ($status < 400) {
return $response['body'];
}
break;
case $status === 406:
$response = $this->call(self::METHOD_POST, $route, $headers, $params, true, $requestTimeout);
$status = $response['headers']['status-code'];
if ($status < 400) {
return $response['body'];
}
break;
default:
throw new \Exception($response['body']['message'], $status);