diff --git a/www-api/app/Controllers/WrenchJobs.php b/www-api/app/Controllers/WrenchJobs.php index 08758e5e..7ae61e52 100644 --- a/www-api/app/Controllers/WrenchJobs.php +++ b/www-api/app/Controllers/WrenchJobs.php @@ -17,9 +17,16 @@ class WrenchJobs extends BaseController $in = json_decode($raw_json, true); $in["action"] = WRENCHBOARD_JOB_STATS_INTEREST; $out=[]; - $ret = $this->wrenchboard->wrenchboard_api($in, $out); - $out['internal_return'] = $ret; - log_message('critical', "***** ***** WrenchJobs::interestStats Ret = ".$ret ); + $endpoint = "CLIENT_STATS-". $in["client_id"]; + + $out = $this->getCache($endpoint); + if ( count($out)==0 ){ + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $this->saveCache($endpoint,$out,15000); + $out['internal_return'] = $ret; + log_message('critical', "***** ***** WrenchJobs::interestStats Cache Done:::Ret ". $ret); + } + log_message('critical', "***** ***** WrenchJobs::interestStats Ret "); return $this->respond( $this->summaryReturnData($in,$out), 200); }