From ab374a90733bbd171e4dd1a58406b842440fab7f Mon Sep 17 00:00:00 2001 From: augushong Date: Sun, 29 Jan 2023 13:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E7=BD=AE=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9D=99=E9=BB=98=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/command/Timer.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/common/command/Timer.php b/app/common/command/Timer.php index 994d6a8..9b67418 100644 --- a/app/common/command/Timer.php +++ b/app/common/command/Timer.php @@ -20,6 +20,8 @@ class Timer extends Command { // 指令配置 $this->setName('timer') + ->addOption('temp', null, Option::VALUE_NONE) + ->addOption('quit', null, Option::VALUE_NONE) ->setDescription('内置秒级定时器'); } @@ -35,6 +37,7 @@ class Timer extends Command $output->writeln('请前往后台设置站点域名(site_domain)配置项'); return; } + $output->writeln('站点域名:'.$site_domain); $client = new Client([ 'base_uri' => $site_domain, @@ -87,8 +90,9 @@ class Timer extends Command } if (empty($list_promises)) { - - $output->writeln(date('Y-m-d H:i:s') . ' no request'); + if(!$input->hasOption('quit')){ + $output->writeln(date('Y-m-d H:i:s') . ' no request'); + } } else { $results = Utils::unwrap($list_promises); $output->writeln(date('Y-m-d H:i:s') . ': request all finished'); @@ -100,7 +104,9 @@ class Timer extends Command } - + if ($input->hasOption('temp')) { + break; + } sleep(1);