Skip to content

Commit 3f36dcb

Browse files
Merge pull request #948 from nextcloud/backport/946/stable22
[stable22] display spent time on request
2 parents 1f4babf + 690c109 commit 3f36dcb

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

lib/Command/CirclesCheck.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,19 +340,25 @@ private function testLoopback(InputInterface $input, OutputInterface $output): b
340340
return false;
341341
}
342342

343+
$timer = round(microtime(true) * 1000);
343344
$output->write('- Creating async FederatedEvent ');
344345
$test = new FederatedEvent(LoopbackTest::class);
345346
$this->federatedEventService->newEvent($test);
346-
347-
$output->writeln('<info>' . $test->getWrapperToken() . '</info>');
347+
$output->writeln(
348+
'<info>' . $test->getWrapperToken() . '</info> ' .
349+
'(took ' . (round(microtime(true) * 1000) - $timer) . 'ms)'
350+
);
348351

349352
$output->writeln('- Waiting for async process to finish (5s)');
350353
sleep(5);
351354

352355
$output->write('- Checking status on FederatedEvent ');
353356
$wrappers = $this->remoteUpstreamService->getEventsByToken($test->getWrapperToken());
357+
354358
if (count($wrappers) !== 1) {
355359
$output->writeln('<error>Event created too many Wrappers</error>');
360+
361+
return false;
356362
}
357363

358364
$wrapper = array_shift($wrappers);
@@ -392,8 +398,10 @@ private function saveLoopback(InputInterface $input, OutputInterface $output, st
392398
[$scheme, $cloudId, $path] = $this->parseAddress($loopback);
393399

394400
$question = new ConfirmationQuestion(
395-
'- Do you want to save <info>' . $loopback
396-
. '</info> as your <info>loopback</info> address ? (y/N) ', false, '/^(y|Y)/i'
401+
'- Do you want to save <info>'
402+
. $loopback
403+
. '</info> as your <info>loopback</info> address ? (y/N) ',
404+
false, '/^(y|Y)/i'
397405
);
398406

399407
$helper = $this->getHelper('question');
@@ -573,8 +581,10 @@ private function saveInternal(InputInterface $input, OutputInterface $output, st
573581

574582
$output->writeln('');
575583
$question = new ConfirmationQuestion(
576-
'- Do you want to save <info>' . $internal
577-
. '</info> as your <info>internal</info> address ? (y/N) ', false, '/^(y|Y)/i'
584+
'- Do you want to save <info>'
585+
. $internal
586+
. '</info> as your <info>internal</info> address ? (y/N) ',
587+
false, '/^(y|Y)/i'
578588
);
579589

580590
$helper = $this->getHelper('question');

0 commit comments

Comments
 (0)