Browse Source

修复知识库项目队列未到运行最大时间 进程就被kill问题

pull/83/head
longchao 2 days ago
parent
commit
afbdb39ec9
  1. 7
      queue/base/dealBase.php
  2. 3
      queue/config/daemonconf.php

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

3
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,
);
);

Loading…
Cancel
Save