From 949266da98de8c624f0d0b26db6656e28ffe5976 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 8 Oct 2024 05:02:32 -0400 Subject: [PATCH] cache hx --- www-api/app/Controllers/WrenchJobs.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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); }