diff --git a/www-api/app/Controllers/WrenchJobs.php b/www-api/app/Controllers/WrenchJobs.php index c3e39059..7244f0a1 100644 --- a/www-api/app/Controllers/WrenchJobs.php +++ b/www-api/app/Controllers/WrenchJobs.php @@ -57,11 +57,14 @@ class WrenchJobs extends BaseController if( is_array($out)){ $countItem = count($out); } - + if ( $countItem == 0 ){ $local_url = "http://".$this->micro_service_net1.":3033/marketjobs"; $out = $this->APIcall('GET', $local_url, $in); - $this->saveCache($endpoint,$out,3000); + // dont cache junk + if ( is_array($out) && is_array($out["result_list"]) && count($out["result_list"]) > 0){ + $this->saveCache($endpoint,$out,180); + } $out['internal_return'] = 0; // just backwad comaptobility log_message('critical', "***** ***** WrenchJobs::getJobsData Cache Done:::Ret "); }