Remove url caching, locking cleanup

This commit is contained in:
Michael 2020-08-06 18:53:45 +00:00
parent c0aebd2bd4
commit f09d9bc9cc
11 changed files with 55 additions and 73 deletions

View file

@ -328,16 +328,8 @@ class Probe
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function uri($uri, $network = '', $uid = -1, $cache = true)
public static function uri($uri, $network = '', $uid = -1)
{
$cachekey = 'Probe::uri:' . $network . ':' . $uri;
if ($cache) {
$result = DI::cache()->get($cachekey);
if (!is_null($result)) {
return $result;
}
}
if ($uid == -1) {
$uid = local_user();
}
@ -408,14 +400,7 @@ class Probe
$data['hide'] = self::getHideStatus($data['url']);
}
$data = self::rearrangeData($data);
// Only store into the cache if the value seems to be valid
if (!in_array($data['network'], [Protocol::PHANTOM, Protocol::MAIL])) {
DI::cache()->set($cachekey, $data, Duration::DAY);
}
return $data;
return self::rearrangeData($data);
}