Skip to content

Commit

Permalink
Keep last 20 players/guilds, ideally this should become a rolling ave…
Browse files Browse the repository at this point in the history
…rage
  • Loading branch information
MaxKorlaar committed Sep 22, 2024
1 parent b5cd6d1 commit 17790f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/ClearRecentlyViewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,21 @@ public function handle(): void {

$this->info('recent_friends size: ' . $recentFriendsCount);

Redis::connection('cache')->zPopMin('recent_friends', max(0, $recentFriendsCount - 10));
Redis::connection('cache')->zPopMin('recent_friends', max(0, $recentFriendsCount - 20));
Redis::connection('cache')->expire('recent_friends', config('cache.times.recent_players'));

$recentGuildsCount = Redis::connection('cache')->zCount('recent_guilds', '-inf', '+inf');

$this->info('recent_guilds size: ' . $recentGuildsCount);

Redis::connection('cache')->zPopMin('recent_guilds', max(0, $recentGuildsCount - 10));
Redis::connection('cache')->zPopMin('recent_guilds', max(0, $recentGuildsCount - 20));
Redis::connection('cache')->expire('recent_guilds', config('cache.times.recent_guilds'));

$recentOnlinePlayersCount = Redis::connection('cache')->zCount('recent_online_players', '-inf', '+inf');

$this->info('recent_online_players size: ' . $recentOnlinePlayersCount);

Redis::connection('cache')->zPopMin('recent_online_players', max(0, $recentOnlinePlayersCount - 10));
Redis::connection('cache')->zPopMin('recent_online_players', max(0, $recentOnlinePlayersCount - 20));
Redis::connection('cache')->expire('recent_online_players', config('cache.times.recent_players'));

foreach (config('recents.blocklist.players') as $uuid) {
Expand Down
2 changes: 1 addition & 1 deletion resources/data/skyblock/SkyCrypt

0 comments on commit 17790f0

Please sign in to comment.