From 00dedb86d00f1d278aa56c73e440b98e555605d0 Mon Sep 17 00:00:00 2001 From: Elena.Budnik <ebudnik@irap.omp.eu> Date: Tue, 13 Mar 2018 16:53:45 +0100 Subject: [PATCH] getUrlFinishedJob --- php/classes/WebServer.php | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) 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