stanley-king преди 3 години
родител
ревизия
e72f008c96
променени са 3 файла, в които са добавени 8 реда и са изтрити 7 реда
  1. 1 1
      docker/compose/xyzt-worker/docker-compose.yml
  2. 5 4
      helper/queue/iqueue.php
  3. 2 2
      mobile/control/refill.php

+ 1 - 1
docker/compose/xyzt-worker/docker-compose.yml

@@ -17,7 +17,7 @@ services:
           cpus: '8'
 
   coall:
-    image: php-swool-redis:latest
+    image: php-swool-hook:7.3.18
     volumes:
       - ../../conf/etc/localtime:/etc/localtime:ro
       - ../../../:/var/www/html

+ 5 - 4
helper/queue/iqueue.php

@@ -8,6 +8,7 @@ require_once(BASE_ROOT_PATH . '/helper/performance_helper.php');
 use Redis;
 use Exception;
 use Log;
+use Swoole;
 
 class IQueueDB
 {
@@ -26,7 +27,7 @@ class IQueueDB
         $this->_comode = $comode;
 
         if ($this->_comode) {
-            $this->_redis = new \Swoole\Coroutine\Redis();
+            $this->_redis = new Swoole\Coroutine\Redis();
             $ret = $this->_redis->connect(C('coroutine.redis_host'), C('coroutine.redis_port'));
         } else {
             $this->_redis = new Redis();
@@ -221,7 +222,7 @@ abstract class ILooper
                 perfor_clear();
                 if(defined('USE_COROUTINE') && USE_COROUTINE)
                 {
-                    $res = \Swoole\Coroutine::stats();
+                    $res = Swoole\Coroutine::stats();
                     $num = $res['coroutine_num'];
                     $mem = memory_get_usage();
                     Log::record("IQueueDB::run coroutin_num={$num} memory={$mem}",Log::DEBUG);
@@ -229,7 +230,7 @@ abstract class ILooper
                     if($num < ILooper::MAX_COROUTINE)
                     {
                         if($this->mServer->connect() == false) {
-                            \Swoole\Coroutine::sleep(1);
+                            Swoole\Coroutine::sleep(1);
                             Log::record("Processor redis disconnect.",Log::ERR);
                             continue;
                         }
@@ -268,7 +269,7 @@ abstract class ILooper
 //                        }
                     }
                     else {
-                        \Swoole\Coroutine::sleep(0.1);
+                        Swoole\Coroutine::sleep(0.1);
                     }
                 }
                 else

+ 2 - 2
mobile/control/refill.php

@@ -118,10 +118,10 @@ class refillControl extends merchantControl
         $mchid = $this->mchid();
         if ($state === true) {
             refill\util::push_queue_order($this->mchid(),$mch_order,ORDER_STATE_QUEUE);
-            Log::record("refill::util::push_add success mchid={$mchid} mch_order={$mch_order}state={$state}",Log::DEBUG);
+            Log::record("refill::util::push_add success mchid={$mchid} mch_order={$mch_order} state={$state}",Log::DEBUG);
             return self::outsuccess(['state' => true]);
         } else {
-            Log::record("refill::util::push_add error mchid={$mchid} mch_order={$mch_order}state={$state}",Log::DEBUG);
+            Log::record("refill::util::push_add error mchid={$mchid} mch_order={$mch_order} state={$state}",Log::DEBUG);
             return self::outerr(208, '提交失败');
         }
     }