diff --git a/www-api/app/Controllers/WrenchGeneralData.php b/www-api/app/Controllers/WrenchGeneralData.php index 1a003d0c..16765a26 100644 --- a/www-api/app/Controllers/WrenchGeneralData.php +++ b/www-api/app/Controllers/WrenchGeneralData.php @@ -6,10 +6,12 @@ class WrenchGeneralData extends BaseController { private $current_env=0; private $primary_image_sever=''; - private$server_tag=''; + private $server_tag=''; + private $wrenchboard; public function __construct() { + $this->wrenchboard = new \App\Models\BackendModel(); $this->current_env = $this->getSiteConfigurations("system.live"); $this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever"); $this->server_tag = $this->getSiteConfigurations("system.server_tag"); @@ -17,19 +19,18 @@ class WrenchGeneralData extends BaseController public function signUpCountry(){ $in["action"] = WRENCHBOARD_SIGNUP_COUNTRY; - - - $wrenchboard = new \App\Models\BackendModel(); - $ret = $wrenchboard->wrenchboard_api($in, $out); - $out['internal_return'] = $ret; - $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); $final_out = ( new \App\Models\ResultFormatter() )->processOutJson($in, $out); - $final_out["environment"] = $this->current_env + 0; + $final_out["environment"] = $this->current_env + 0; $final_out["session_image_server"] = $this->primary_image_sever; $final_out["server_tag"] = $this->server_tag; $final_out["language"] = "en";