mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-07-01 12:57:26 +00:00
[Change] CacheStore-local, CacheStore-redis 适配 CacheStore-API 模块的更改;
[Change] LocalCacheStoreFactory 适配更改; [Change] RedisCacheStoreFactory 适配更改, 增加 Redis 配置文件相关逻辑; [Change] RedisConnectionPool 增加 Redis 连接配置功能;
This commit is contained in:
@ -20,6 +20,8 @@ package net.lamgc.cgj.bot.cache.local;
|
||||
import net.lamgc.cgj.bot.cache.*;
|
||||
import net.lamgc.cgj.bot.cache.convert.StringConverter;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* 本地缓存存储容器工厂.
|
||||
* 最快速但又是最占内存的方法, 适用于远端缓存失效, 或无远端缓存的情况下使用.
|
||||
@ -29,6 +31,11 @@ import net.lamgc.cgj.bot.cache.convert.StringConverter;
|
||||
@Factory(name = "Local-Memory", priority = FactoryPriority.PRIORITY_LOWEST, source = CacheStoreSource.MEMORY)
|
||||
public class LocalCacheStoreFactory implements CacheStoreFactory {
|
||||
|
||||
@Override
|
||||
public void initial(File dataDirectory) {
|
||||
// 不需要做任何事情, 除非需要做持久化.
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> SingleCacheStore<V> newSingleCacheStore(String identify, StringConverter<V> converter) {
|
||||
return new HashSingleCacheStore<>();
|
||||
|
Reference in New Issue
Block a user