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);
$out =[];
$in["action"] = WRENCHBOARD_ACCOUNT_HOMEBANNERS;
if (isset($in["uuid"]) && $in["uuid"] !='' ){
$in["uid"]=$in["uuid"];
}
$in["nocache"] = $in["nocache"] ?? false;
$endpoint = "ACCOUNT-HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
if ($in["nocache"]) $this->deleteCache($endpoint);
try{
$out = $this->getCache($endpoint); // try find in cache
$previous_banners = false;
if (is_array($out) && count($out)> 0 /*&& is_array($out['result_list']) && count($out['result_list'])>0*/ ){
$previous_banners = true;
}
if (isset($in["uuid"]) && $in["uuid"] !='' ){
$in["uid"]=$in["uuid"];
}
$in["nocache"] = $in["nocache"] ?? false;
$endpoint = "ACCOUNT-HOMEBANNERS-".str_replace("-", "_", $in["uid"]);
if ($in["nocache"]) $this->deleteCache($endpoint);
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);
$out = $this->getCache($endpoint); // try find in cache
$previous_banners = false;
if (is_array($out) && count($out)> 0 /*&& is_array($out['result_list']) && count($out['result_list'])>0*/ ){
$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 );
}
+2 -1
View File
@@ -116,7 +116,8 @@ class WrenchJobs extends BaseController
$out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : [];
} 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 ");
return $this->respond( $this->summaryReturnData($in,$out), 200);