stanley-king 3 роки тому
батько
коміт
b7b2ff75e4

+ 6 - 0
core/framework/cache/cache.redis.php

@@ -257,4 +257,10 @@ class CacheRedis extends Cache
         if (!$this->enable) return false;
         return $this->handler->del($key);
     }
+
+    public function lLen($key) {
+        $this->init_master();
+        if (!$this->enable) return false;
+        return $this->handler->lLen($key);
+    }
 }

+ 6 - 0
helper/refill/util.php

@@ -300,6 +300,12 @@ class util
         }
     }
 
+    public static function dispatcher_queue_length()
+    {
+        $ins = Cache::getInstance('cacheredis');
+        return $ins->lLen('QUEUE_DISPATCHER_CO');
+    }
+
     //统计提交订单数据
     public static function incr_commit_pre($chname, $card_type, $spec, $quality)
     {

+ 6 - 2
rdispatcher/proxy.php

@@ -89,13 +89,17 @@ class proxy
             elseif(($errcode === refill\errcode::MERCHANT_REFILL_ERROR && $neterr) || $errcode == refill\errcode::PROVIDER_OVERLOAD || $errcode == errcode::MERCHANT_PRICE_UNSETTING)
             {
                 [$org_quality,$quality] = refill\RefillFactory::instance()->find_quality($mchid,$amount,$card_type,$org_quality,$commit_times,time() - $order_time,'',$regin_no);
-                if ($quality > 0) {
+                if ($quality > 0)
+                {
                     $fNotify = false;
                     $params['order_id'] = $order_id;
                     if($order_id > 0) {
                         $refill_order->edit($order_id, ['is_retrying' => 1]);
                     }
-                    refill\util::push_add($params);
+
+                    if(!refill\util::push_add($params)) {
+                        $fNotify = true;
+                    }
                 }
             }