country cache

This commit is contained in:
CHIEFSOFT\ameye
2024-07-04 21:09:25 -04:00
parent 47acbc436f
commit ea0dba9f9d
@@ -6,10 +6,12 @@ class WrenchGeneralData extends BaseController
{ {
private $current_env=0; private $current_env=0;
private $primary_image_sever=''; private $primary_image_sever='';
private$server_tag=''; private $server_tag='';
private $wrenchboard;
public function __construct() public function __construct()
{ {
$this->wrenchboard = new \App\Models\BackendModel();
$this->current_env = $this->getSiteConfigurations("system.live"); $this->current_env = $this->getSiteConfigurations("system.live");
$this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever"); $this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever");
$this->server_tag = $this->getSiteConfigurations("system.server_tag"); $this->server_tag = $this->getSiteConfigurations("system.server_tag");
@@ -17,15 +19,14 @@ class WrenchGeneralData extends BaseController
public function signUpCountry(){ public function signUpCountry(){
$in["action"] = WRENCHBOARD_SIGNUP_COUNTRY; $in["action"] = WRENCHBOARD_SIGNUP_COUNTRY;
$wrenchboard = new \App\Models\BackendModel();
$ret = $wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
$endpoint = "SIGNUP_COUNTRY-"; $endpoint = "SIGNUP_COUNTRY-";
$this->saveCache($endpoint,$out,$timeLine=15000);
$out = $this->getCache($endpoint); // try find in cache
if ( empty($out) || !is_array($out)){
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
$this->saveCache($endpoint,$out,$timeLine=15000);
}
// $this->doCacheStep($in, $out); // $this->doCacheStep($in, $out);
$final_out = ( new \App\Models\ResultFormatter() )->processOutJson($in, $out); $final_out = ( new \App\Models\ResultFormatter() )->processOutJson($in, $out);