mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-23 15:29:50 +00:00
Update NotificationService
This commit is contained in:
parent
251723ccc0
commit
519c05de32
1 changed files with 10 additions and 0 deletions
|
@ -81,6 +81,16 @@ class NotificationService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function setNotification(Notification $notification)
|
||||||
|
{
|
||||||
|
return Cache::remember('service:notification:'.$notification->id, now()->addDays(7), function() use($notification) {
|
||||||
|
$fractal = new Fractal\Manager();
|
||||||
|
$fractal->setSerializer(new ArraySerializer());
|
||||||
|
$resource = new Fractal\Resource\Item($notification, new NotificationTransformer());
|
||||||
|
return $fractal->createData($resource)->toArray();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static function warmCache($id, $stop = 100, $force = false)
|
public static function warmCache($id, $stop = 100, $force = false)
|
||||||
{
|
{
|
||||||
if(self::count($id) == 0 || $force == true) {
|
if(self::count($id) == 0 || $force == true) {
|
||||||
|
|
Loading…
Reference in a new issue