verify completed jobs

This commit is contained in:
CHIEFSOFT\ameye
2024-08-22 05:16:42 -04:00
parent 3b3b94cf98
commit 70557f7419
2 changed files with 20 additions and 0 deletions
+1
View File
@@ -41,6 +41,7 @@ $routes->get('/en/wrench/api/v1/startjoblist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/dashdata', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/getjobsdata', 'WrenchJobs::getJobsData'); //WrenchJobs WrenchApi apigate
$routes->post('/en/wrench/api/v1/verifycompleted', 'WrenchJobs::verifyCompletedHx');
$routes->post('/en/wrench/api/v1/offerslist', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/offersresponse', 'WrenchApi::apigate');
+19
View File
@@ -12,6 +12,25 @@ class WrenchJobs extends BaseController
$this->request = $request = \Config\Services::request();
}
public function verifyCompletedHx(){
//http://localhost:3033/completedHx
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$in["action"] = -1;
$out=[];
$endpoint = "COMPLETED_HX-". $in["uid"];
$out = $this->getCache($endpoint);
if ( count($out)==0 ){
$local_url = "http://".$this->micro_service_net1.":3033/completedHx";
$out = $this->APIcall('GET', $local_url, $in);
$this->saveCache($endpoint,$out,10000);
$out['internal_return'] = 0; // just backwad comaptobility
log_message('critical', "***** ***** WrenchJobs::verifyCompletedHx Cache Done:::Ret ");
}
log_message('critical', "***** ***** WrenchJobs::verifyCompletedHx Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
public function getJobsData() {
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);