Update StatusHashtagService, remove problemaatic cache layer

pull/4774/head
Daniel Supernault 2023-11-16 00:29:10 -07:00
rodzic 33a60e767d
commit e5401f8558
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 8 dodań i 12 usunięć

Wyświetl plik

@ -84,18 +84,14 @@ class StatusHashtagService {
public static function statusTags($statusId)
{
$key = 'pf:services:sh:id:' . $statusId;
$status = Status::with('hashtags')->find($statusId);
if(!$status) {
return [];
}
return Cache::remember($key, 604800, function() use($statusId) {
$status = Status::find($statusId);
if(!$status) {
return [];
}
$fractal = new Fractal\Manager();
$fractal->setSerializer(new ArraySerializer());
$resource = new Fractal\Resource\Collection($status->hashtags, new HashtagTransformer());
return $fractal->createData($resource)->toArray();
});
$fractal = new Fractal\Manager();
$fractal->setSerializer(new ArraySerializer());
$resource = new Fractal\Resource\Collection($status->hashtags, new HashtagTransformer());
return $fractal->createData($resource)->toArray();
}
}