error ctach

This commit is contained in:
CHIEFSOFT\ameye
2024-11-28 02:16:53 -05:00
parent dacc848015
commit 12d45f37b2
2 changed files with 31 additions and 21 deletions
+29 -20
View File
@@ -84,34 +84,43 @@ class WrenchBanners extends BaseController
$in = json_decode($raw_json, true); $in = json_decode($raw_json, true);
$out =[]; $out =[];
$in["action"] = WRENCHBOARD_ACCOUNT_HOMEBANNERS; $in["action"] = WRENCHBOARD_ACCOUNT_HOMEBANNERS;
if (isset($in["uuid"]) && $in["uuid"] !='' ){
$in["uid"]=$in["uuid"];
}
$in["nocache"] = $in["nocache"] ?? false; try{
$endpoint = "ACCOUNT-HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
if ($in["nocache"]) $this->deleteCache($endpoint);
$out = $this->getCache($endpoint); // try find in cache if (isset($in["uuid"]) && $in["uuid"] !='' ){
$previous_banners = false; $in["uid"]=$in["uuid"];
if (is_array($out) && count($out)> 0 /*&& is_array($out['result_list']) && count($out['result_list'])>0*/ ){ }
$previous_banners = true;
}
$in["nocache"] = $in["nocache"] ?? false;
$endpoint = "ACCOUNT-HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
if ($in["nocache"]) $this->deleteCache($endpoint);
if ( !$previous_banners ){ $out = $this->getCache($endpoint); // try find in cache
$ret = $this->wrenchboard->wrenchboard_api($in, $out); $previous_banners = false;
$out['internal_return'] = $ret; if (is_array($out) && count($out)> 0 /*&& is_array($out['result_list']) && count($out['result_list'])>0*/ ){
log_message('critical', "usersBanners ********* ALL ".serialize($out) );
// dont cache junks
if (is_array($out) /* && is_array($out['result_list']) && count($out['result_list'])>0 */) {
$this->saveCache($endpoint, $out, 1500);
$previous_banners = true; $previous_banners = true;
} }
if ( !$previous_banners ){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
log_message('critical', "usersBanners ********* ALL ".serialize($out) );
// dont cache junks
if (is_array($out) /* && is_array($out['result_list']) && count($out['result_list'])>0 */) {
$this->saveCache($endpoint, $out, 1500);
$previous_banners = true;
}
}
$extra_out["offers_list"] = $this->bannerGetOffers($in);
$extra_out["activetaskslist"] = $this->bannerGetActiveTasks($in);
} catch (Exception $e) {
$errMsg = ' BANNER DATA ERROR **** Caught exception: '. $e->getMessage();
log_message('critical', $errMsg);
} }
$extra_out["offers_list"] = $this->bannerGetOffers($in);
$extra_out["activetaskslist"] = $this->bannerGetActiveTasks($in);
return $this->summaryReturnData($in,$out, $extra_out); //json_encode( $final_out ); return $this->summaryReturnData($in,$out, $extra_out); //json_encode( $final_out );
} }
+2 -1
View File
@@ -116,7 +116,8 @@ class WrenchJobs extends BaseController
$out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : []; $out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : [];
} catch (Exception $e) { } catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n"; $errMsg = ' JOB DATA ERROR **** Caught exception: '. $e->getMessage();
log_message('critical', $errMsg);
} }
log_message('critical', "END ***** ***** WrenchJobs::getJobsData Ret "); log_message('critical', "END ***** ***** WrenchJobs::getJobsData Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200); return $this->respond( $this->summaryReturnData($in,$out), 200);