mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 08:44:49 +00:00
Update AccountService, fixes #1834
This commit is contained in:
parent
5b8d2c4418
commit
eb478ccf76
1 changed files with 10 additions and 10 deletions
|
@ -14,16 +14,16 @@ class AccountService {
|
||||||
|
|
||||||
public static function get($id)
|
public static function get($id)
|
||||||
{
|
{
|
||||||
$key = self::CACHE_KEY . ':' . $id;
|
// $key = self::CACHE_KEY . ':' . $id;
|
||||||
$ttl = now()->addHours(12);
|
// $ttl = now()->addSeconds(10);
|
||||||
|
// return Cache::remember($key, $ttl, function() use($id) {
|
||||||
|
// });
|
||||||
|
|
||||||
return Cache::remember($key, $ttl, function() use($id) {
|
|
||||||
$fractal = new Fractal\Manager();
|
$fractal = new Fractal\Manager();
|
||||||
$fractal->setSerializer(new ArraySerializer());
|
$fractal->setSerializer(new ArraySerializer());
|
||||||
$profile = Profile::whereNull('status')->findOrFail($id);
|
$profile = Profile::whereNull('status')->findOrFail($id);
|
||||||
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
||||||
return $fractal->createData($resource)->toArray();
|
return $fractal->createData($resource)->toArray();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue