mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
feat: 优化定时任务输出
This commit is contained in:
@@ -48,14 +48,16 @@ class TimerBase extends Command
|
||||
|
||||
return;
|
||||
}
|
||||
$site_host = parse_url($site_domain, PHP_URL_HOST);
|
||||
$output->writeln('站点域名:' . $site_domain);
|
||||
|
||||
$host = $site_domain;
|
||||
|
||||
if ($input->hasOption('local')) {
|
||||
$host = $input->getOption('local-host') . ':' . $input->getOption('local-port');
|
||||
}
|
||||
|
||||
$output->writeln('站点域名:' . $host);
|
||||
$site_host = parse_url($host, PHP_URL_HOST);
|
||||
|
||||
$config_list = include app_file_path('common/command/timer/config.php');
|
||||
|
||||
$request_list = [];
|
||||
@@ -132,7 +134,7 @@ class TimerBase extends Command
|
||||
Timer::add(1, function () use ($worker, $host, $site_host, $output, $input, $http) {
|
||||
$request_list = $worker->timerRequestList;
|
||||
foreach ($request_list as $request_item) {
|
||||
$output->writeln(date('Y-m-d H:i:s') . ': build site request async:' . $request_item['target']);
|
||||
$output->writeln(date('Y-m-d H:i:s') . ': build site request async: ' . $request_item['target']);
|
||||
if (!isset($request_item['is_running'])) {
|
||||
$request_item['is_running'] = false;
|
||||
}
|
||||
@@ -211,7 +213,7 @@ class TimerBase extends Command
|
||||
$type = $request_item['type'];
|
||||
switch ($type) {
|
||||
case 'site':
|
||||
$output->writeln(date('Y-m-d H:i:s') . ': build site request async:' . $request_item['target']);
|
||||
$output->writeln(date('Y-m-d H:i:s') . ': build site request async: ' . $request_item['target']);
|
||||
$list_promises[$request_item['name']] = $client->getAsync($request_item['target']);
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user