From 093f8f8dfd66b27362d3dac29cb739197edcc6b9 Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 24 Mar 2020 14:58:13 +0800 Subject: [PATCH] ComposerUpdate --- app/admin/view/queue/index.html | 2 +- composer.lock | 8 ++++---- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- vendor/zoujingli/think-library/src/Library.php | 2 +- vendor/zoujingli/think-library/src/Storage.php | 10 +++++----- .../think-library/src/command/queue/CleanQueue.php | 12 +++++++----- .../think-library/src/storage/AliossStorage.php | 2 +- .../think-library/src/storage/LocalStorage.php | 2 +- .../think-library/src/storage/QiniuStorage.php | 2 +- 10 files changed, 26 insertions(+), 24 deletions(-) diff --git a/app/admin/view/queue/index.html b/app/admin/view/queue/index.html index 5d2c7697b..679f22a8d 100644 --- a/app/admin/view/queue/index.html +++ b/app/admin/view/queue/index.html @@ -15,7 +15,7 @@ {/if} {if auth("clear")} - + {/if} {/block} diff --git a/composer.lock b/composer.lock index 29df900f3..04570bea5 100644 --- a/composer.lock +++ b/composer.lock @@ -909,12 +909,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "28760760070a34a5b21ab1d6754b223d139d79a3" + "reference": "a247fea1b1a6b9bbc9f378f944531f222800fab5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/28760760070a34a5b21ab1d6754b223d139d79a3", - "reference": "28760760070a34a5b21ab1d6754b223d139d79a3", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a247fea1b1a6b9bbc9f378f944531f222800fab5", + "reference": "a247fea1b1a6b9bbc9f378f944531f222800fab5", "shasum": "", "mirrors": [ { @@ -958,7 +958,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-03-24T02:35:13+00:00" + "time": "2020-03-24T06:40:00+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 949994d19..4b41d2375 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -935,12 +935,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "28760760070a34a5b21ab1d6754b223d139d79a3" + "reference": "a247fea1b1a6b9bbc9f378f944531f222800fab5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/28760760070a34a5b21ab1d6754b223d139d79a3", - "reference": "28760760070a34a5b21ab1d6754b223d139d79a3", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/a247fea1b1a6b9bbc9f378f944531f222800fab5", + "reference": "a247fea1b1a6b9bbc9f378f944531f222800fab5", "shasum": "", "mirrors": [ { @@ -956,7 +956,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-03-24T02:35:13+00:00", + "time": "2020-03-24T06:40:00+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index f56b0a5b9..e866c4759 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/Library.php b/vendor/zoujingli/think-library/src/Library.php index 1898b27b0..07b72b1f5 100644 --- a/vendor/zoujingli/think-library/src/Library.php +++ b/vendor/zoujingli/think-library/src/Library.php @@ -29,7 +29,7 @@ use function Composer\Autoload\includeFile; class Library extends Service { /** - * 注册服务 + * 注册初始化服务 */ public function register() { diff --git a/vendor/zoujingli/think-library/src/Storage.php b/vendor/zoujingli/think-library/src/Storage.php index b51bcae32..28947ee5c 100644 --- a/vendor/zoujingli/think-library/src/Storage.php +++ b/vendor/zoujingli/think-library/src/Storage.php @@ -65,7 +65,7 @@ abstract class Storage /** * 存储初始化 - * @return AliossStorage|LocalStorage|QiniuStorage + * @return Storage|AliossStorage|LocalStorage|QiniuStorage * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -81,7 +81,7 @@ abstract class Storage * @param string $method 方法名称 * @param array $arguments 调用参数 * @return mixed - * @throws \think\Exception + * @throws Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -91,7 +91,7 @@ abstract class Storage if (method_exists($class = self::instance(), $method)) { return call_user_func_array([$class, $method], $arguments); } else { - throw new \think\Exception("method not exists: " . get_class($class) . "->{$method}()"); + throw new Exception("method not exists: " . get_class($class) . "->{$method}()"); } } @@ -99,7 +99,7 @@ abstract class Storage * 设置文件驱动名称 * @param string $name 驱动名称 * @return AliossStorage|LocalStorage|QiniuStorage - * @throws \think\Exception + * @throws Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -110,7 +110,7 @@ abstract class Storage if (class_exists($object = "think\\admin\\storage\\{$class}Storage")) { return Container::getInstance()->make($object)->initialize(); } else { - throw new \think\Exception("File driver [{$class}] does not exist."); + throw new Exception("File driver [{$class}] does not exist."); } } diff --git a/vendor/zoujingli/think-library/src/command/queue/CleanQueue.php b/vendor/zoujingli/think-library/src/command/queue/CleanQueue.php index d7937a327..b71c621ff 100644 --- a/vendor/zoujingli/think-library/src/command/queue/CleanQueue.php +++ b/vendor/zoujingli/think-library/src/command/queue/CleanQueue.php @@ -53,17 +53,19 @@ class CleanQueue extends Queue { $this->time = $input->getArgument('time'); if (empty($this->time) || !is_numeric($this->time) || $this->time <= 0) { - $this->output->error('Wrong parameter, the deadline needs to be an integer'); + $this->setQueueMessage(4, "参数错误,需要传入任务超时时间"); } else { $map = [['exec_time', '<', time() - $this->time]]; $count1 = $this->app->db->name($this->table)->where($map)->delete(); - $this->output->info("Successfully cleaned up {$count1} history task records"); + $this->setQueueProgress(2, "清理 {$count1} 条历史任务成功", 50); // 重置超60分钟无响应的记录 $map = [['exec_time', '<', time() - 3600], ['status', '=', '2']]; - $count2 = $this->app->db->name($this->table)->where($map)->update(['status' => '4', 'exec_desc' => '执行等待超过60分钟无响应']); - $this->output->info("Successfully processed {$count2} unresponsive records waiting for more than 1 hour"); + $count2 = $this->app->db->name($this->table)->where($map)->update([ + 'status' => '4', 'exec_desc' => '任务执行超时,已自动标识为失败!', + ]); + $this->setQueueProgress(2, "处理 {$count2} 条超时间任务成功", 100); // 返回消息到任务状态描述 - if (defined('WorkQueueCall')) throw new \think\admin\Exception("清理 {$count1} 条 + 无响应 {$count2} 条", 3); + $this->setQueueMessage(3, "共清理 {$count1} 条 + 无响应 {$count2} 条"); } } } \ No newline at end of file diff --git a/vendor/zoujingli/think-library/src/storage/AliossStorage.php b/vendor/zoujingli/think-library/src/storage/AliossStorage.php index db9778b64..b1bf88a76 100644 --- a/vendor/zoujingli/think-library/src/storage/AliossStorage.php +++ b/vendor/zoujingli/think-library/src/storage/AliossStorage.php @@ -85,7 +85,7 @@ class AliossStorage extends Storage * 获取当前实例对象 * @param null $name * @return AliossStorage|LocalStorage|QiniuStorage - * @throws \think\Exception + * @throws \think\admin\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException diff --git a/vendor/zoujingli/think-library/src/storage/LocalStorage.php b/vendor/zoujingli/think-library/src/storage/LocalStorage.php index 1d65b79ac..1bafc5e53 100644 --- a/vendor/zoujingli/think-library/src/storage/LocalStorage.php +++ b/vendor/zoujingli/think-library/src/storage/LocalStorage.php @@ -54,7 +54,7 @@ class LocalStorage extends Storage * 获取当前实例对象 * @param null $name * @return AliossStorage|LocalStorage|QiniuStorage - * @throws \think\Exception + * @throws \think\admin\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException diff --git a/vendor/zoujingli/think-library/src/storage/QiniuStorage.php b/vendor/zoujingli/think-library/src/storage/QiniuStorage.php index b077322ec..5a05c6dd0 100644 --- a/vendor/zoujingli/think-library/src/storage/QiniuStorage.php +++ b/vendor/zoujingli/think-library/src/storage/QiniuStorage.php @@ -59,7 +59,7 @@ class QiniuStorage extends Storage * 获取当前实例对象 * @param null $name * @return AliossStorage|LocalStorage|QiniuStorage - * @throws \think\Exception + * @throws \think\admin\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException