From 741ccb4fb4865ea33e0f9e44c8442e3cc6033df3 Mon Sep 17 00:00:00 2001 From: "iyuu.cn" <367013672@qq.com> Date: Thu, 20 Feb 2020 17:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=A7=E4=BA=8E=E4=B8=80?= =?UTF-8?q?=E4=B8=87=E6=9D=A1=E5=81=9A=E7=A7=8D=E6=97=B6=E8=BE=85=E7=A7=8D?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AutoReseed.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/AutoReseed.php b/app/AutoReseed.php index a5323c3..2547890 100644 --- a/app/AutoReseed.php +++ b/app/AutoReseed.php @@ -276,7 +276,6 @@ class AutoReseed continue; } self::backup('clients_'.$k, $hashArray); - // 此处需要优化大于一万条做种时,应分批上传 $infohash_Dir = $hashArray['hashString']; unset($hashArray['hashString']); // 签名 @@ -286,6 +285,11 @@ class AutoReseed // 写请求日志 wlog($hashArray, 'hashString'.$k); self::$wechatMsg['hashCount'] +=count($infohash_Dir); + // 此处优化大于一万条做种时,设置超时 + if(self::$wechatMsg['hashCount'] > 5000){ + self::$curl->setOpt(CURLOPT_CONNECTTIMEOUT,$configALL['default']['CONNECTTIMEOUT']); + self::$curl->setOpt(CURLOPT_TIMEOUT,$configALL['default']['TIMEOUT']); + } echo "正在向服务器提交 clients_".$k." 种子哈希……".PHP_EOL; $res = self::$curl->post(self::$apiUrl . self::$endpoints['infohash'], $hashArray); $res = json_decode($res->response, true);