diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d1e4cbe87..af06a114b 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -834,12 +834,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "111780326730bce8f7103d09a97de741d23a8fc7" + "reference": "385e86100c264130347432a65e765b67bcabbc10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/111780326730bce8f7103d09a97de741d23a8fc7", - "reference": "111780326730bce8f7103d09a97de741d23a8fc7", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/385e86100c264130347432a65e765b67bcabbc10", + "reference": "385e86100c264130347432a65e765b67bcabbc10", "shasum": "", "mirrors": [ { @@ -856,7 +856,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2021-03-20T09:21:53+00:00", + "time": "2021-03-24T02:12:51+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 845856bea..c4627427a 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/command/Queue.php b/vendor/zoujingli/think-library/src/command/Queue.php index e81cce096..a4aec6678 100644 --- a/vendor/zoujingli/think-library/src/command/Queue.php +++ b/vendor/zoujingli/think-library/src/command/Queue.php @@ -226,21 +226,19 @@ class Queue extends Command /** * 立即监听任务 - * @throws \Exception + * @throws \think\db\exception\DbException */ protected function listenAction() { set_time_limit(0); + ignore_user_abort(true); $this->app->db->setLog(new NullLogger()); $this->app->db->name($this->table)->count(); - if ($this->process->iswin()) { - $this->setProcessTitle("ThinkAdmin {$this->process->version()} Queue Listen"); - } $this->output->writeln("\tYou can exit with `CTRL-C`"); - $this->output->writeln('============== LISTENING =============='); + $this->output->writeln('=============== LISTENING ==============='); while (true) { - [$start, $where] = [microtime(true), [['status', '=', 1], ['exec_time', '<=', time()]]]; - foreach ($this->app->db->name($this->table)->where($where)->order('exec_time asc')->cursor() as $vo) try { + [$map, $start] = [[['status', '=', 1], ['exec_time', '<=', time()]], microtime(true)]; + foreach ($this->app->db->name($this->table)->where($map)->order('exec_time asc')->cursor() as $vo) try { $args = "xadmin:queue dorun {$vo['code']} -"; $this->output->comment(">$ {$this->process->think($args)}"); if (count($this->process->thinkQuery($args)) > 0) { @@ -261,11 +259,12 @@ class Queue extends Command /** * 执行指定的任务内容 - * @throws \Exception + * @throws \think\db\exception\DbException */ protected function doRunAction() { set_time_limit(0); + ignore_user_abort(true); $this->code = trim($this->input->getArgument('code')); if (empty($this->code)) { $this->output->error('Task number needs to be specified for task execution'); @@ -281,10 +280,6 @@ class Queue extends Command 'outer_time' => 0, 'exec_pid' => getmypid(), 'exec_desc' => '', 'status' => 2, ]); $this->queue->progress(2, '>>> 任务处理开始 <<<', 0); - // 设置进程标题 - if ($this->process->iswin()) { - $this->setProcessTitle("ThinkAdmin {$this->process->version()} Queue - {$this->queue->title}"); - } // 执行任务内容 defined('WorkQueueCall') or define('WorkQueueCall', true); defined('WorkQueueCode') or define('WorkQueueCode', $this->code); @@ -316,7 +311,7 @@ class Queue extends Command * @param integer $status 任务状态 * @param string $message 消息内容 * @param boolean $isSplit 是否分隔 - * @throws \Exception + * @throws \think\db\exception\DbException */ protected function updateQueue(int $status, string $message, bool $isSplit = true) {