Fix cache

This commit is contained in:
CHIEFSOFT\ameye
2024-07-20 19:17:23 -04:00
parent c5ee7778f6
commit cf5d16f8fc
+10 -3
View File
@@ -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);
}