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 +); +