From 2bf3a38686d619985b00d97cfd1b963cb1fc1eeb Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 18 Nov 2020 10:26:26 +0800 Subject: [PATCH] ComposerUpdate --- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- vendor/zoujingli/think-library/src/command/Queue.php | 4 ++-- vendor/zoujingli/think-library/src/helper/QueryHelper.php | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 9c0e61ea8..c4262f344 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -937,12 +937,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "db5d81e44af053a3a3f19c1593c2d5e52d58084c" + "reference": "7689af12e89d95c0ca5ddacd4142fcfa0af6ad5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/db5d81e44af053a3a3f19c1593c2d5e52d58084c", - "reference": "db5d81e44af053a3a3f19c1593c2d5e52d58084c", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/7689af12e89d95c0ca5ddacd4142fcfa0af6ad5f", + "reference": "7689af12e89d95c0ca5ddacd4142fcfa0af6ad5f", "shasum": "", "mirrors": [ { @@ -959,7 +959,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2020-11-10T03:25:39+00:00", + "time": "2020-11-18T02:17:40+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 6fc54efa2..146069a0e 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 247247502..d64ab2403 100644 --- a/vendor/zoujingli/think-library/src/command/Queue.php +++ b/vendor/zoujingli/think-library/src/command/Queue.php @@ -233,7 +233,7 @@ class Queue extends Command $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')->select()->toArray() as $vo) try { + foreach ($this->app->db->name($this->table)->where($where)->order('exec_time asc')->cursor() as $vo) try { $command = $this->process->think("xadmin:queue dorun {$vo['code']} -"); $this->output->comment("># {$command}"); if (count($this->process->query($command)) > 0) { @@ -248,7 +248,7 @@ class Queue extends Command ]); $this->output->error(">> Execution failed -> [{$vo['code']}] {$vo['title']},{$exception->getMessage()}"); } - if (microtime(true) - $start < 0.5000) usleep(500000); + if (microtime(true) < $start + 1) usleep(1000000); } } diff --git a/vendor/zoujingli/think-library/src/helper/QueryHelper.php b/vendor/zoujingli/think-library/src/helper/QueryHelper.php index 4d15dec55..2cb2186fd 100644 --- a/vendor/zoujingli/think-library/src/helper/QueryHelper.php +++ b/vendor/zoujingli/think-library/src/helper/QueryHelper.php @@ -148,7 +148,8 @@ class QueryHelper extends Helper public function dateBetween($fields, string $split = ' - ', $input = null, string $alias = '#'): QueryHelper { return $this->_setBetweenWhere($fields, $split, $input, $alias, function ($value, $type) { - return $type === 'after' ? "{$value} 23:59:59" : "{$value} 00:00:00"; + if (preg_match('#^\d{4}(-\d\d){2}\s+\d\d(:\d\d){2}$#', $value)) return $value; + else return $type === 'after' ? "{$value} 23:59:59" : "{$value} 00:00:00"; }); } @@ -163,7 +164,8 @@ class QueryHelper extends Helper public function timeBetween($fields, string $split = ' - ', $input = null, string $alias = '#'): QueryHelper { return $this->_setBetweenWhere($fields, $split, $input, $alias, function ($value, $type) { - return $type === 'after' ? strtotime("{$value} 23:59:59") : strtotime("{$value} 00:00:00"); + if (preg_match('#^\d{4}(-\d\d){2}\s+\d\d(:\d\d){2}$#', $value)) return strtotime($value); + else return $type === 'after' ? strtotime("{$value} 23:59:59") : strtotime("{$value} 00:00:00"); }); }