ComposerUpdate

This commit is contained in:
Anyon 2020-11-18 10:26:26 +08:00
parent d97b035049
commit 2bf3a38686
4 changed files with 11 additions and 9 deletions

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": "db5d81e44af053a3a3f19c1593c2d5e52d58084c" "reference": "7689af12e89d95c0ca5ddacd4142fcfa0af6ad5f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/db5d81e44af053a3a3f19c1593c2d5e52d58084c", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/7689af12e89d95c0ca5ddacd4142fcfa0af6ad5f",
"reference": "db5d81e44af053a3a3f19c1593c2d5e52d58084c", "reference": "7689af12e89d95c0ca5ddacd4142fcfa0af6ad5f",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -959,7 +959,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-11-10T03:25:39+00:00", "time": "2020-11-18T02:17:40+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-11-07 23:06:26 // This file is automatically generated at:2020-11-18 10:26:02
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -233,7 +233,7 @@ class Queue extends Command
$this->output->writeln('============== LISTENING =============='); $this->output->writeln('============== LISTENING ==============');
while (true) { while (true) {
[$start, $where] = [microtime(true), [['status', '=', 1], ['exec_time', '<=', time()]]]; [$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']} -"); $command = $this->process->think("xadmin:queue dorun {$vo['code']} -");
$this->output->comment("># {$command}"); $this->output->comment("># {$command}");
if (count($this->process->query($command)) > 0) { 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()}"); $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);
} }
} }

View File

@ -148,7 +148,8 @@ class QueryHelper extends Helper
public function dateBetween($fields, string $split = ' - ', $input = null, string $alias = '#'): QueryHelper public function dateBetween($fields, string $split = ' - ', $input = null, string $alias = '#'): QueryHelper
{ {
return $this->_setBetweenWhere($fields, $split, $input, $alias, function ($value, $type) { 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 public function timeBetween($fields, string $split = ' - ', $input = null, string $alias = '#'): QueryHelper
{ {
return $this->_setBetweenWhere($fields, $split, $input, $alias, function ($value, $type) { 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");
}); });
} }