Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/Command/CirclesCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

use Exception;
use OC\Core\Command\Base;
use OC\Memcache\APCu;
use OCA\Circles\AppInfo\Application;
use OCA\Circles\AppInfo\Capabilities;
use OCA\Circles\Exceptions\FederatedEventException;
Expand Down Expand Up @@ -39,6 +40,7 @@
use OCA\Circles\Tools\Traits\TNCRequest;
use OCA\Circles\Tools\Traits\TStringTools;
use OCP\IAppConfig;
use OCP\IConfig;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -67,6 +69,7 @@ class CirclesCheck extends Base {
public function __construct(
private Capabilities $capabilities,
private IAppConfig $appConfig,
private IConfig $config,
private InterfaceService $interfaceService,
private FederatedEventService $federatedEventService,
private RemoteService $remoteService,
Expand Down Expand Up @@ -262,6 +265,17 @@ private function testLoopback(InputInterface $input, OutputInterface $output): b
return false;
}

$localIsApcu = ltrim($this->config->getSystemValueString('memcache.local'), '\\') === '\OC\Memcache\APCu';
if ($localIsApcu) {
/*
* APCu cache is not shared between the CLI process and web requests, so freshly
* set values will either be missing or stale and make the check fail.
* The amount of seconds slept here depends on the TTL set by the AppConfig.
*/
$output->writeln('- Waiting for APCu config cache to refresh (4s)');
sleep(4);
}

if (!$this->testRequest(
$output, 'POST', 'circles.EventWrapper.asyncBroadcast',
['token' => 'test-dummy-token']
Expand Down
Loading