forked from mirror/pixelfed
Update StatusHashtagService, remove problemaatic cache layer
This commit is contained in:
parent
33a60e767d
commit
e5401f8558
1 changed files with 8 additions and 12 deletions
|
@ -84,10 +84,7 @@ class StatusHashtagService {
|
||||||
|
|
||||||
public static function statusTags($statusId)
|
public static function statusTags($statusId)
|
||||||
{
|
{
|
||||||
$key = 'pf:services:sh:id:' . $statusId;
|
$status = Status::with('hashtags')->find($statusId);
|
||||||
|
|
||||||
return Cache::remember($key, 604800, function() use($statusId) {
|
|
||||||
$status = Status::find($statusId);
|
|
||||||
if(!$status) {
|
if(!$status) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -96,6 +93,5 @@ class StatusHashtagService {
|
||||||
$fractal->setSerializer(new ArraySerializer());
|
$fractal->setSerializer(new ArraySerializer());
|
||||||
$resource = new Fractal\Resource\Collection($status->hashtags, new HashtagTransformer());
|
$resource = new Fractal\Resource\Collection($status->hashtags, new HashtagTransformer());
|
||||||
return $fractal->createData($resource)->toArray();
|
return $fractal->createData($resource)->toArray();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue