mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
Update Services, use zpopmin on predis
This commit is contained in:
parent
1cc6274ac0
commit
4b2c66f557
3 changed files with 3 additions and 9 deletions
|
@ -24,9 +24,7 @@ class LikeService {
|
|||
public static function setAdd($profileId, $statusId)
|
||||
{
|
||||
if(self::setCount($profileId) > 400) {
|
||||
if(config('database.redis.client') === 'phpredis') {
|
||||
Redis::zpopmin(self::CACHE_SET_KEY . $profileId);
|
||||
}
|
||||
Redis::zpopmin(self::CACHE_SET_KEY . $profileId);
|
||||
}
|
||||
|
||||
return Redis::zadd(self::CACHE_SET_KEY . $profileId, $statusId, $statusId);
|
||||
|
|
|
@ -49,9 +49,7 @@ class NetworkTimelineService
|
|||
public static function add($val)
|
||||
{
|
||||
if(self::count() > config('instance.timeline.network.cache_dropoff')) {
|
||||
if(config('database.redis.client') === 'phpredis') {
|
||||
Redis::zpopmin(self::CACHE_KEY);
|
||||
}
|
||||
Redis::zpopmin(self::CACHE_KEY);
|
||||
}
|
||||
|
||||
return Redis::zadd(self::CACHE_KEY, $val, $val);
|
||||
|
|
|
@ -49,9 +49,7 @@ class PublicTimelineService {
|
|||
public static function add($val)
|
||||
{
|
||||
if(self::count() > 400) {
|
||||
if(config('database.redis.client') === 'phpredis') {
|
||||
Redis::zpopmin(self::CACHE_KEY);
|
||||
}
|
||||
Redis::zpopmin(self::CACHE_KEY);
|
||||
}
|
||||
|
||||
return Redis::zadd(self::CACHE_KEY, $val, $val);
|
||||
|
|
Loading…
Reference in a new issue