Skip to content

Commit 57e9424

Browse files
authored
Merge pull request #63200 from nextcloud/fix/do-not-rediscover-when-cached-as-false
fix: Respect cached false for OCM discovery
2 parents 359e7c5 + cbc9f1a commit 57e9424

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

lib/private/OCM/OCMDiscoveryService.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,19 @@ public function discover(string $remote, bool $skipCache = false): IOCMProvider
100100
$provider = new OCMProvider();
101101

102102
if (!$skipCache) {
103-
try {
104-
$cached = $this->cache->get($remote);
105-
if ($cached === false) {
106-
throw new OCMProviderException('Previous discovery failed.');
107-
}
103+
$cached = $this->cache->get($remote);
104+
if ($cached === false) {
105+
throw new OCMProviderException('Previous discovery failed.');
106+
}
108107

109-
if ($cached !== null) {
108+
if ($cached !== null) {
109+
try {
110110
$provider->import(json_decode($cached, true, 8, JSON_THROW_ON_ERROR) ?? []);
111111
$this->remoteProviders[$remote] = $provider;
112112
return $provider;
113+
} catch (JsonException|OCMProviderException $e) {
114+
$this->logger->warning('cache issue on ocm discovery', ['exception' => $e]);
113115
}
114-
} catch (JsonException|OCMProviderException $e) {
115-
$this->logger->warning('cache issue on ocm discovery', ['exception' => $e]);
116116
}
117117
}
118118

0 commit comments

Comments
 (0)