新增 锁管理器,支持本地锁和分布式锁,当开启集群时,自动使用分布式锁

This commit is contained in:
thinkgem
2025-09-24 22:01:36 +08:00
parent 4741e75975
commit e2b7db9668
3 changed files with 34 additions and 7 deletions

View File

@@ -632,10 +632,10 @@ j2cache:
redis:
# 存储模式 generic|hash
storage: hash
# 通知订阅的通道名
channel: jeesite
# 缓存命名空间名
namespace: jeesite
# 通知订阅的通道名
channel: ${j2cache.redis.namespace}
# 消息监听器
#listener:
# taskPool:
@@ -652,6 +652,15 @@ j2cache:
# blend -> 两种模式一起运作,对于各个节点缓存准确以及及时性要求高的可以使用,正常用前两种模式中一个就可
cache_clean_mode: passive
# 锁管理器支持本地锁和分布式锁当isClusterMode开启时自动使用分布式锁
lockManager:
# 分布式锁
redis:
# 锁名称前缀多系统共用Redis时修改
keyPrefix: ${j2cache.redis.namespace}:lockKey
# 检查锁的等待毫秒数
sleepMillis: 100
# Web 相关
web:

View File

@@ -780,10 +780,10 @@ session:
# redis:
# # 存储模式 generic|hash
# storage: hash
# # 通知订阅的通道名
# channel: jeesite
# # 缓存命名空间名
# namespace: jeesite
# # 通知订阅的通道名
# channel: ${j2cache.redis.namespace}
# # 消息监听器
# listener:
# taskPool:
@@ -799,7 +799,16 @@ session:
# # active -> 主动清除,二级缓存过期主动通知各节点清除,优点在于所有节点可以同时收到缓存清除,存储模式需要设置为 generic
# # blend -> 两种模式一起运作,对于各个节点缓存准确以及及时性要求高的可以使用,正常用前两种模式中一个就可
# cache_clean_mode: passive
# 锁管理器支持本地锁和分布式锁当isClusterMode开启时自动使用分布式锁
#lockManager:
# # 分布式锁
# redis:
# # 锁名称前缀多系统共用Redis时修改
# keyPrefix: ${j2cache.redis.namespace}:lockKey
# # 检查锁的等待毫秒数
# sleepMillis: 100
# Web 相关
web:

View File

@@ -780,10 +780,10 @@ session:
# redis:
# # 存储模式 generic|hash
# storage: hash
# # 通知订阅的通道名
# channel: jeesite
# # 缓存命名空间名
# namespace: jeesite
# # 通知订阅的通道名
# channel: ${j2cache.redis.namespace}
# # 消息监听器
# listener:
# taskPool:
@@ -800,6 +800,15 @@ session:
# # blend -> 两种模式一起运作,对于各个节点缓存准确以及及时性要求高的可以使用,正常用前两种模式中一个就可
# cache_clean_mode: passive
# 锁管理器支持本地锁和分布式锁当isClusterMode开启时自动使用分布式锁
#lockManager:
# # 分布式锁
# redis:
# # 锁名称前缀多系统共用Redis时修改
# keyPrefix: ${j2cache.redis.namespace}:lockKey
# # 检查锁的等待毫秒数
# sleepMillis: 100
# Web 相关
web: