diff --git a/composer.lock b/composer.lock index 94eadd5da..fb4cf0749 100644 --- a/composer.lock +++ b/composer.lock @@ -915,12 +915,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "8faeb22f7b2f9a279911b6497de1c6856b368eba" + "reference": "98dce0c32ecde5bdf1e60a3572d8ece6fe828c37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/8faeb22f7b2f9a279911b6497de1c6856b368eba", - "reference": "8faeb22f7b2f9a279911b6497de1c6856b368eba", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/98dce0c32ecde5bdf1e60a3572d8ece6fe828c37", + "reference": "98dce0c32ecde5bdf1e60a3572d8ece6fe828c37", "shasum": "", "mirrors": [ { @@ -964,7 +964,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-05-15T07:37:07+00:00" + "time": "2020-05-16T08:45:15+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index a1fbb6f45..ca7885a4b 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -941,12 +941,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "8faeb22f7b2f9a279911b6497de1c6856b368eba" + "reference": "98dce0c32ecde5bdf1e60a3572d8ece6fe828c37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/8faeb22f7b2f9a279911b6497de1c6856b368eba", - "reference": "8faeb22f7b2f9a279911b6497de1c6856b368eba", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/98dce0c32ecde5bdf1e60a3572d8ece6fe828c37", + "reference": "98dce0c32ecde5bdf1e60a3572d8ece6fe828c37", "shasum": "", "mirrors": [ { @@ -962,7 +962,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-05-15T07:37:07+00:00", + "time": "2020-05-16T08:45:15+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 2ea5d0a4b..7b5cf4538 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/Command.php b/vendor/zoujingli/think-library/src/Command.php index 66890ef28..e38b6e5f9 100644 --- a/vendor/zoujingli/think-library/src/Command.php +++ b/vendor/zoujingli/think-library/src/Command.php @@ -44,11 +44,13 @@ class Command extends ThinkCommand * 初始化指令变量 * @param Input $input * @param Output $output + * @return $this */ protected function initialize(Input $input, Output $output) { $this->queue = QueueService::instance(); $this->process = ProcessService::instance(); + return $this; } /** diff --git a/vendor/zoujingli/think-library/src/command/Queue.php b/vendor/zoujingli/think-library/src/command/Queue.php index c00d0cf77..8aaa36408 100644 --- a/vendor/zoujingli/think-library/src/command/Queue.php +++ b/vendor/zoujingli/think-library/src/command/Queue.php @@ -283,22 +283,22 @@ class Queue extends Command // 自定义任务,支持返回消息(支持异常结束,异常码可选择 3|4 设置任务状态) $class = $this->app->make($command, [], true); if ($class instanceof \think\admin\Queue) { - $this->update(3, $class->initialize($this->queue)->execute($this->queue->data)); + $this->updateQueue(3, $class->initialize($this->queue)->execute($this->queue->data)); } elseif ($class instanceof \think\admin\service\QueueService) { - $this->update(3, $class->initialize($this->queue->code)->execute($this->queue->data)); + $this->updateQueue(3, $class->initialize($this->queue->code)->execute($this->queue->data)); } else { throw new \think\admin\Exception("自定义 {$command} 未继承 Queue 或 QueueService"); } } else { // 自定义指令,不支持返回消息(支持异常结束,异常码可选择 3|4 设置任务状态) $attr = explode(' ', trim(preg_replace('|\s+|', ' ', $this->queue->record['command']))); - $this->update(3, $this->app->console->call(array_shift($attr), $attr)->fetch(), false); + $this->updateQueue(3, $this->app->console->call(array_shift($attr), $attr)->fetch(), false); } } } catch (\Exception|\Error $exception) { $code = $exception->getCode(); if (intval($code) !== 3) $code = 4; - $this->update($code, $exception->getMessage()); + $this->updateQueue($code, $exception->getMessage()); } }