Skip to content

Commit

Permalink
Also cache invalid DiscoveryService response
Browse files Browse the repository at this point in the history
* Cache it for a day so we will retry eventually
* Cache the status.php response as well so we will try it once a day as
well

Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer committed Dec 13, 2017
1 parent 2943b54 commit 3b343e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/files_sharing/lib/External/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private function testRemoteUrl($url) {
$returnValue = false;
}

$cache->set($url, $returnValue);
$cache->set($url, $returnValue, 60*60*24);
return $returnValue;
}

Expand Down
3 changes: 1 addition & 2 deletions lib/private/OCS/DiscoveryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ public function discover($remote, $service) {
}
} catch (\Exception $e) {
// if we couldn't discover the service or any end-points we return a empty array
return [];
}

// Write into cache
$this->cache->set($remote . '#' . $service, json_encode($discoveredServices));
$this->cache->set($remote . '#' . $service, json_encode($discoveredServices), 60*60*24);
return $discoveredServices;
}

Expand Down

0 comments on commit 3b343e2

Please sign in to comment.