Commit 00dedb86d00f1d278aa56c73e440b98e555605d0
1 parent
d9c16908
Exists in
master
and in
111 other branches
getUrlFinishedJob
Showing
1 changed file
with
28 additions
and
3 deletions
Show diff stats
php/classes/WebServer.php
... | ... | @@ -428,10 +428,35 @@ class WebServer |
428 | 428 | if (!isset($this->requestManager)) |
429 | 429 | $this->requestManager = new RequestManagerClass(); |
430 | 430 | |
431 | - try { | |
431 | + try | |
432 | + { | |
432 | 433 | $res = $this->requestManager->runWSRequest($this->userID, 'unknown', FunctionTypeEnumClass::PROCESSGETINFO, null, $id); |
433 | - } catch (Exception $e) { | |
434 | - $this->throwError("getStatusError", "Exeption detected : ".$e->getMessage()); | |
434 | + } | |
435 | + catch (Exception $e) | |
436 | + { | |
437 | +// if ($e->getMessage() == "Exception detected : Request execution error : Cannot get process from id" ) | |
438 | +// { | |
439 | + // after first getStatus() call process is cleaned up | |
440 | + $jobsManager = new WSJobsManagerClass(); | |
441 | + | |
442 | + try | |
443 | + { | |
444 | + $res = $jobsManager->getResultFromProcessId($id); | |
445 | + if (!$res['success']) { | |
446 | + $this->throwError("processError","Cannot retrieve process $id info"); | |
447 | + } | |
448 | + | |
449 | + return array('success' => true, 'status' => 'done', 'dataFileURLs' => WSConfigClass::getUrl().$res['result']); | |
450 | + } | |
451 | + catch (Exception $e) | |
452 | + { | |
453 | + $this->throwError("getResultFromProcessIdError", "Exception detected : ".$e->getMessage()); | |
454 | + } | |
455 | +// } | |
456 | +// else | |
457 | +// { | |
458 | +// $this->throwError("getStatusError", "Exception detected : ".$e->getMessage()); | |
459 | +// } | |
435 | 460 | } |
436 | 461 | |
437 | 462 | if (!$res['success']) { |
... | ... |