From afbdb39ec9670e584fd11e24fe664e62e1f52262 Mon Sep 17 00:00:00 2001 From: longchao <1432334894@qq.com> Date: Wed, 16 Jul 2025 11:42:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9F=A5=E8=AF=86=E5=BA=93?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=98=9F=E5=88=97=E6=9C=AA=E5=88=B0=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=9C=80=E5=A4=A7=E6=97=B6=E9=97=B4=20=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E5=B0=B1=E8=A2=ABkill=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- queue/base/dealBase.php | 7 +++++++ queue/config/daemonconf.php | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/queue/base/dealBase.php b/queue/base/dealBase.php index 2cad4e1..e8b31ee 100644 --- a/queue/base/dealBase.php +++ b/queue/base/dealBase.php @@ -24,6 +24,7 @@ abstract class dealBase extends publicBase { private $deal_flag=''; // 队列类别标识 private $proc_code; // 当前队列自定义进程数号码标识 private $close_path; // 开关标识文件 + protected $server_ip; public function __construct() { $this->path_conf = dirname(dirname(__FILE__))."/config/daemonconf.php"; @@ -44,6 +45,8 @@ abstract class dealBase extends publicBase { include_once($this->path_conf); + $this->server_ip = $this->getServerIp(); + $this->setPara(); if($this->processnum+0==0) $this->processnum = 1; @@ -92,6 +95,10 @@ abstract class dealBase extends publicBase { protected function setProcHealth() { $proc_path = sprintf($this->path_proc, $this->proc_code.'_'.md5($this->path_deal)); + $obj = new mBase(); + $rdobj = $obj->initRedis(); + $res = $rdobj->set(sprintf(_DAEMON_HEALTH, $this->server_ip, $this->deal_flag, $this->proc_code), time()); + $handle = fopen($proc_path, 'w'); if(!$handle) { return false; diff --git a/queue/config/daemonconf.php b/queue/config/daemonconf.php index 05d6cec..d5340e8 100644 --- a/queue/config/daemonconf.php +++ b/queue/config/daemonconf.php @@ -22,4 +22,5 @@ $GLOBALS['DAEMON_LIST_DESC'] = array( $GLOBALS['DAEMON_NUMLIMIT'] = array( SPIDER_WEIBO_BEHAVIOR => 5, SPIDER_WEIBO_COMMENT => 6, -); \ No newline at end of file +); +