diff --git a/app/http.php b/app/http.php index 5daf32b..dda23c9 100644 --- a/app/http.php +++ b/app/http.php @@ -624,16 +624,16 @@ function (string $runtimeId, string $payload, array $variables, int $timeout, st } // Ensure runtime started - for ($i = 0; $i < 5; $i++) { + for ($i = 0; $i < 50; $i++) { if ($activeRuntimes->get($activeRuntimeId)['status'] !== 'pending') { break; } - if ($i === 4) { + if ($i === 49) { throw new Exception('Runtime failed to launch in allocated time.', 500); } - \sleep(1); + \sleep(0.1); } // Ensure we have secret @@ -696,7 +696,7 @@ function (string $runtimeId, string $payload, array $variables, int $timeout, st }; // Execute function - for ($i = 0; $i < 5; $i++) { + for ($i = 0; $i < 50; $i++) { [ 'errNo' => $errNo, 'error' => $error, 'statusCode' => $statusCode, 'executorResponse' => $executorResponse ] = \call_user_func($sendExecuteRequest); // No error @@ -708,11 +708,11 @@ function (string $runtimeId, string $payload, array $variables, int $timeout, st throw new Exception('An internal curl error has occurred within the executor! Error Msg: ' . $error, 500); } - if ($i === 4) { + if ($i === 49) { throw new Exception('An internal curl error has occurred within the executor! Error Msg: ' . $error, 500); } - \sleep(1); + \sleep(0.1); } // Extract response