feat(cache): 启用缓存过期机制 #2
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/cache-expiration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
修改内容
UserInfoCache.java
Duration cacheTtl字段,默认 24 小时过期get(UUID)方法现在会检查过期,过期自动删除cleanup()方法已启用,可被定时调用清理所有过期条目size()、clear()、getIfPresent()辅助方法MinerooCore.java
onEnable()末尾添加异步定时任务userInfoCache.cleanup()runTaskTimerAsynchronously不阻塞主线程解决问题
修复缓存永不过期导致的潜在内存泄漏问题。
测试建议