RedisException

Connection refused

/var/www/cms.moglilabs.com/protected/components/RedisOperation.php(26)

14 
15        public function set($key, $data){
16            $stored_key = REDIS_APP_KEY_PREFIX."_".$key;
17            $redis = new Redis();
18            $redis->connect(REDIS_SERVER_URL, REDIS_PORT_NUMBER);
19            $redis->set($stored_key, $data);
20        }
21 
22        public function get($key){
23          $data = null;
24            $stored_key = REDIS_APP_KEY_PREFIX."_".$key;
25            $redis = new Redis();
26            $redis->connect(REDIS_SERVER_URL, REDIS_PORT_NUMBER);
27            if($redis->exists($stored_key)){
28             $data = $redis->get($stored_key);
29          }
30            return $data;
31        }
32 
33       public function delete($key){
34          $stored_key = REDIS_APP_KEY_PREFIX."_".$key;
35          $redis = new Redis();
36          $redis->connect(REDIS_SERVER_URL, REDIS_PORT_NUMBER);
37          $redis->del($stored_key);
38       }

Stack Trace

#0
+
 /var/www/cms.moglilabs.com/protected/components/RedisOperation.php(26): Redis->connect("127.0.0.1", "6379")
21 
22        public function get($key){
23          $data = null;
24            $stored_key = REDIS_APP_KEY_PREFIX."_".$key;
25            $redis = new Redis();
26            $redis->connect(REDIS_SERVER_URL, REDIS_PORT_NUMBER);
27            if($redis->exists($stored_key)){
28             $data = $redis->get($stored_key);
29          }
30            return $data;
31        }
#1
+
 /var/www/cms.moglilabs.com/protected/modules/Cms/controllers/ApiLayoutController.php(550): RedisOperation->get("CM881267")
545 
546         else{
547                $layoutCodearr = Yii::app()->params['CMS_LAYOUT_JSON_ID'];
548             $key = $layoutCodearr[1];
549     }
550         if($redis->get($key) == null){
551 
552         foreach ($layoutCodearr as $layoutCode) {
553         $layoutData = Layout::model()->getLayoutByCode($layoutCode);
554 
555             if($layoutData){
#9
+
 /var/www/cms.moglilabs.com/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-11-14 01:59:22 nginx/1.14.0 Yii Framework/1.1.16