make scheduled methoded protected, fix connection

This commit is contained in:
2025-10-21 22:22:43 +02:00
parent 7e25cc583c
commit a55806e5dd
2 changed files with 17 additions and 3 deletions
@@ -50,7 +50,7 @@ public class LoginController implements LoginApi {
private static final ConcurrentMap<String, CacheEntry> cache = new ConcurrentHashMap<>();
@Scheduled(fixedRate = 300000) // 5 minutes in milliseconds
private void clearExpiredCacheEntries() {
protected void clearExpiredCacheEntries() {
Instant now = Instant.now();
int initialCacheSize = cache.size();
cache.entrySet().removeIf(entry -> entry.getValue().expiry().isBefore(now));