ComposerUpdate

This commit is contained in:
Anyon 2020-08-14 15:03:16 +08:00
parent b08e7ee83c
commit ef3c6ce7f3
5 changed files with 17 additions and 12 deletions

8
composer.lock generated
View File

@ -937,12 +937,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "032fd6e5bd304a2fd7e8d964c2e125db55d4e9db" "reference": "194317296e5d7483727d895670d96d73b5da0167"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/032fd6e5bd304a2fd7e8d964c2e125db55d4e9db", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/194317296e5d7483727d895670d96d73b5da0167",
"reference": "032fd6e5bd304a2fd7e8d964c2e125db55d4e9db", "reference": "194317296e5d7483727d895670d96d73b5da0167",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -986,7 +986,7 @@
], ],
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"homepage": "http://thinkadmin.top", "homepage": "http://thinkadmin.top",
"time": "2020-08-14T05:29:39+00:00" "time": "2020-08-14T06:51:29+00:00"
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",

View File

@ -963,12 +963,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "44e1ec7dbb25d5304da0f599bfcfc667cab7d61f" "reference": "194317296e5d7483727d895670d96d73b5da0167"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/44e1ec7dbb25d5304da0f599bfcfc667cab7d61f", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/194317296e5d7483727d895670d96d73b5da0167",
"reference": "44e1ec7dbb25d5304da0f599bfcfc667cab7d61f", "reference": "194317296e5d7483727d895670d96d73b5da0167",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -984,7 +984,7 @@
"ext-json": "*", "ext-json": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-08-14T05:34:24+00:00", "time": "2020-08-14T06:51:29+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2020-08-14 13:37:19 // This file is automatically generated at:2020-08-14 15:03:14
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -38,7 +38,7 @@ class Version extends Command
*/ */
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$output->writeln('ThinkLib ' . $this->process->version());
$output->writeln('ThinkPHP ' . $this->app->version()); $output->writeln('ThinkPHP ' . $this->app->version());
$output->writeln('ThinkLIB ' . $this->process->version());
} }
} }

View File

@ -154,6 +154,7 @@ class QueueService extends Service
*/ */
public function progress($status = null, $message = null, $progress = null) public function progress($status = null, $message = null, $progress = null)
{ {
$cachefile = "queue_{$this->code}_progress";
if (is_numeric($status) && intval($status) === 3) { if (is_numeric($status) && intval($status) === 3) {
if (!is_numeric($progress)) $progress = '100.00'; if (!is_numeric($progress)) $progress = '100.00';
if (is_null($message)) $message = '>>> 任务已经完成 <<<'; if (is_null($message)) $message = '>>> 任务已经完成 <<<';
@ -163,7 +164,11 @@ class QueueService extends Service
if (is_null($message)) $message = '>>> 任务执行失败 <<<'; if (is_null($message)) $message = '>>> 任务执行失败 <<<';
} }
try { try {
$data = $this->app->cache->get("queue_{$this->code}_progress", [ // 文件缓存时,重置 opcache 缓存
if (function_exists('opcache_invalidate') && strtolower($this->app->cache->getDefaultDriver()) === 'file') {
@opcache_invalidate($this->app->cache->getCacheKey($cachefile), true);
}
$data = $this->app->cache->get($cachefile, [
'code' => $this->code, 'status' => $status, 'message' => $message, 'progress' => $progress, 'history' => [], 'code' => $this->code, 'status' => $status, 'message' => $message, 'progress' => $progress, 'history' => [],
]); ]);
} catch (\Exception|\Error $exception) { } catch (\Exception|\Error $exception) {
@ -186,7 +191,7 @@ class QueueService extends Service
if (count($data['history']) > 10) { if (count($data['history']) > 10) {
$data['history'] = array_slice($data['history'], -10); $data['history'] = array_slice($data['history'], -10);
} }
$this->app->cache->set("queue_{$this->code}_progress", $data, 86400); $this->app->cache->set($cachefile, $data, 86400);
} }
return $data; return $data;
} }