diff --git a/www-api/app/Controllers/WrenchJobs.php b/www-api/app/Controllers/WrenchJobs.php index d277af5f..f7d3de41 100644 --- a/www-api/app/Controllers/WrenchJobs.php +++ b/www-api/app/Controllers/WrenchJobs.php @@ -140,10 +140,13 @@ class WrenchJobs extends BaseController public function contractHx(){ $raw_json = file_get_contents('php://input'); $in = json_decode($raw_json, true); - - $out=[]; - $local_url = "http://".$this->micro_service_net1.":3033/contractHx"; - $out = $this->APIcall('GET', $local_url, $in ); + $endpoint = "USER_CONTRACT_HX-". $in["uid"]; + $out = $this->getCache($endpoint); + if ( count($out)==0 ){ + $local_url = "http://".$this->micro_service_net1.":3033/contractHx"; + $out = $this->APIcall('GET', $local_url, $in ); + $this->saveCache($endpoint,$out,360); + } return $this->respond( $this->summaryReturnData($in,$out), 3000); }