Commit c0e578daabf9ea007e682a0d8b4abae86402771e
1 parent
ba82a624
Exists in
master
and in
63 other branches
Fix get job info request (#6340)
Showing
2 changed files
with
13 additions
and
12 deletions
Show diff stats
src/InputOutput/IHMImpl/Process/IHMInputOutputGetInfoProcessClass.php
... | ... | @@ -41,13 +41,6 @@ class IHMInputOutputGetInfoProcessClass implements InputOutputInterface |
41 | 41 | */ |
42 | 42 | public function getOutput($data) |
43 | 43 | { |
44 | - if (!$data->getSuccess()) | |
45 | - { | |
46 | - return array( | |
47 | - 'success' => false, | |
48 | - 'message' => $data->getLastErrorMessage()); | |
49 | - } | |
50 | - | |
51 | 44 | return $this->jobsManager->getJobInfo($this->paramsData->getId()); |
52 | 45 | } |
53 | 46 | } |
... | ... |
src/Request/ProcessRequestImpl/ProcessRequestClass.php
... | ... | @@ -110,7 +110,8 @@ class ProcessRequestClass extends RequestAbstractClass |
110 | 110 | |
111 | 111 | //create the process manager |
112 | 112 | $processMgr = new ProcessManagerClass($this->requestData->getManagerFilePath()); |
113 | - | |
113 | + | |
114 | + $return_code = FALSE; | |
114 | 115 | switch ($this->requestData->getType()) |
115 | 116 | { |
116 | 117 | case ProcessTypeEnumClass::RUN : |
... | ... | @@ -121,25 +122,32 @@ class ProcessRequestClass extends RequestAbstractClass |
121 | 122 | $this->requestData->getEnvVars(), |
122 | 123 | $this->requestData->getPostCmd(), |
123 | 124 | $this->requestData->getBatchEnable()); |
124 | - if ($result['success']) | |
125 | + if ($result['success']) { | |
126 | + $return_code = TRUE; | |
125 | 127 | $this->updateProcess($result['result'], $processMgr); |
128 | + } | |
126 | 129 | break; |
127 | 130 | case ProcessTypeEnumClass::DELETE : |
128 | 131 | //delete process |
129 | 132 | $result = $processMgr->deleteProcess($this->requestData->getId()); |
130 | - if ($result['success']) | |
133 | + if ($result['success']) { | |
134 | + $return_code = TRUE; | |
131 | 135 | $result = $result['result']; |
136 | + } | |
132 | 137 | break; |
133 | 138 | case ProcessTypeEnumClass::INFO : |
134 | 139 | //get process info |
135 | 140 | $result = $processMgr->getProcessInfo($this->requestData->getId(),true); |
136 | 141 | if ($result['success']) |
137 | 142 | $this->updateProcess($result['result'], $processMgr); |
143 | + $return_code = TRUE; //Return TRUE even if the process cannot be retrieved | |
138 | 144 | break; |
139 | 145 | case ProcessTypeEnumClass::KILL : |
140 | 146 | $result = $processMgr->killProcess($this->requestData->getId()); |
141 | - if ($result['success']) | |
147 | + if ($result['success']) { | |
148 | + $return_code = TRUE; | |
142 | 149 | $result = $result['result']; |
150 | + } | |
143 | 151 | break; |
144 | 152 | default : |
145 | 153 | $this->requestData->setLastErrorMessage("Process method not implemented"); |
... | ... | @@ -151,7 +159,7 @@ class ProcessRequestClass extends RequestAbstractClass |
151 | 159 | if (!$result['success']) |
152 | 160 | $this->requestData->setLastErrorMessage($result['message']); |
153 | 161 | |
154 | - return ($result['success']); | |
162 | + return $return_code; | |
155 | 163 | } |
156 | 164 | } |
157 | 165 | ?> |
... | ... |