stanley-king 3 yıl önce
ebeveyn
işleme
efbe3ef6a2

+ 11 - 2
core/framework/cache/cache.redis.php

@@ -33,8 +33,12 @@ class CacheRedis extends Cache
                 Log::record("CacheRedis init_slave disconnect.",Log::DEBUG);
             }
     	}
+        if (is_mobile()) {
+            $func = 'connect';
+        } else {
+            $func = $this->config['pconnect'] ? 'pconnect' : 'connect';
+        }
 
-        $func = $this->config['pconnect'] ? 'pconnect' : 'connect';
         $this->handler  = new Redis();
         $this->enable = $this->handler->$func($this->config['master']['host'], $this->config['master']['port']);
         $_cache = $this->handler;
@@ -54,7 +58,12 @@ class CacheRedis extends Cache
             }
         }
 
-        $func = $this->config['pconnect'] ? 'pconnect' : 'connect';
+        if (is_mobile()) {
+            $func = 'connect';
+        } else {
+            $func = $this->config['pconnect'] ? 'pconnect' : 'connect';
+        }
+
         $this->handler = new Redis();
         $this->enable = $this->handler->$func($this->config['slave']['host'], $this->config['slave']['port']);
         $_cache = $this->handler;

+ 1 - 2
helper/message/subscriber.php

@@ -58,14 +58,13 @@ class subscriber extends Thread
             catch (Exception $ex)
             {
                 Log::record("subscriber quit err={$ex->getMessage()} code={$ex->getCode()}");
+                sleep(1);
             }
         }
     }
 
     public function dispatch($channel,$msg)
     {
-        Log::record("subscriber dispatch ch={$channel} msg={$msg}",Log::DEBUG);
-
         if(empty($msg)) return false;
         $msg = json_decode($msg,true);
         if($msg == false || !is_array($msg)) {

+ 1 - 2
test/TestHttp.php

@@ -38,8 +38,7 @@ class TestHttp extends TestCase
     public function testRefillAdd()
     {
         $time = time() * 1000;
-        for ($i = 1;$i < 10; $i++)
-        {
+        for ($i = 1;$i < 1000; $i++) {
             $this->push_order(1092, $time, $i);
         }
     }