diff --git a/lib/Backgroundjobs/ObtainCapabilities.php b/lib/Backgroundjobs/ObtainCapabilities.php index 3156d77b93..66ecd00daf 100644 --- a/lib/Backgroundjobs/ObtainCapabilities.php +++ b/lib/Backgroundjobs/ObtainCapabilities.php @@ -6,6 +6,7 @@ namespace OCA\Richdocuments\Backgroundjobs; +use OCA\Richdocuments\AppConfig; use OCA\Richdocuments\Service\CapabilitiesService; use OCA\Richdocuments\Service\DiscoveryService; use OCP\AppFramework\Utility\ITimeFactory; @@ -18,6 +19,7 @@ public function __construct( private LoggerInterface $logger, private CapabilitiesService $capabilitiesService, private DiscoveryService $discoveryService, + private AppConfig $appConfig, ) { parent::__construct($time); @@ -25,6 +27,10 @@ public function __construct( } protected function run($argument) { + if (!$this->appConfig->getCollaboraUrlInternal()) { + return; + } + try { $this->capabilitiesService->fetch(); } catch (\Exception $e) { diff --git a/lib/Service/ConnectivityService.php b/lib/Service/ConnectivityService.php index 113c7dfff6..fd19fb16f1 100644 --- a/lib/Service/ConnectivityService.php +++ b/lib/Service/ConnectivityService.php @@ -38,7 +38,7 @@ public function testDiscovery(OutputInterface $output): void { public function testCapabilities(OutputInterface $output): void { $this->capabilitiesService->resetCache(); - $this->capabilitiesService->fetch(true); + $this->capabilitiesService->fetch(); $output->writeln('✓ Fetched /hosting/capabilities endpoint'); if ($this->capabilitiesService->getCapabilities() === []) {