Also cache invalid DiscoveryService response

* 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 <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-12-13 14:51:48 +01:00
parent 2943b54f98
commit 3b343e287f
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 2 additions and 3 deletions

View File

@ -280,7 +280,7 @@ class Storage extends DAV implements ISharedStorage {
$returnValue = false;
}
$cache->set($url, $returnValue);
$cache->set($url, $returnValue, 60*60*24);
return $returnValue;
}

View File

@ -81,11 +81,10 @@ class DiscoveryService implements IDiscoveryService {
}
} 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;
}