diff --git a/php/classes/WebServer.php b/php/classes/WebServer.php index 8f0239d..dc566e8 100644 --- a/php/classes/WebServer.php +++ b/php/classes/WebServer.php @@ -428,10 +428,35 @@ class WebServer if (!isset($this->requestManager)) $this->requestManager = new RequestManagerClass(); - try { + try + { $res = $this->requestManager->runWSRequest($this->userID, 'unknown', FunctionTypeEnumClass::PROCESSGETINFO, null, $id); - } catch (Exception $e) { - $this->throwError("getStatusError", "Exeption detected : ".$e->getMessage()); + } + catch (Exception $e) + { +// if ($e->getMessage() == "Exception detected : Request execution error : Cannot get process from id" ) +// { + // after first getStatus() call process is cleaned up + $jobsManager = new WSJobsManagerClass(); + + try + { + $res = $jobsManager->getResultFromProcessId($id); + if (!$res['success']) { + $this->throwError("processError","Cannot retrieve process $id info"); + } + + return array('success' => true, 'status' => 'done', 'dataFileURLs' => WSConfigClass::getUrl().$res['result']); + } + catch (Exception $e) + { + $this->throwError("getResultFromProcessIdError", "Exception detected : ".$e->getMessage()); + } +// } +// else +// { +// $this->throwError("getStatusError", "Exception detected : ".$e->getMessage()); +// } } if (!$res['success']) { -- libgit2 0.21.2