org.redisson.config.Config.setLockWatchdogTimeout()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(496)

本文整理了Java中org.redisson.config.Config.setLockWatchdogTimeout()方法的一些代码示例,展示了Config.setLockWatchdogTimeout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.setLockWatchdogTimeout()方法的具体详情如下:
包路径:org.redisson.config.Config
类名称:Config
方法名:setLockWatchdogTimeout

Config.setLockWatchdogTimeout介绍

[英]This parameter is only used if lock has been acquired without leaseTimeout parameter definition. Lock will be expired after lockWatchdogTimeout if watchdog didn't extend it to next lockWatchdogTimeout time interval.

This prevents against infinity locked locks due to Redisson client crush or any other reason when lock can't be released in proper way.

Default is 30000 milliseconds
[中]仅当在未定义leaseTimeout参数的情况下获取锁时,才使用此参数。如果看门狗没有将锁延长到下一个lockWatchdogTimeout时间间隔,则锁将在lockWatchdogTimeout之后过期。
这可以防止由于Redisson客户端崩溃或任何其他原因导致锁无法以适当方式释放而无限锁定。
默认值为30000毫秒

代码示例

代码示例来源:origin: redisson/redisson

setLockWatchdogTimeout(oldConf.getLockWatchdogTimeout());
setNettyThreads(oldConf.getNettyThreads());
setThreads(oldConf.getThreads());

代码示例来源:origin: redisson/redisson

setLockWatchdogTimeout(oldConf.getLockWatchdogTimeout());
setNettyThreads(oldConf.getNettyThreads());
setThreads(oldConf.getThreads());

代码示例来源:origin: org.redisson/redisson

setUseScriptCache(oldConf.isUseScriptCache());
setKeepPubSubOrder(oldConf.isKeepPubSubOrder());
setLockWatchdogTimeout(oldConf.getLockWatchdogTimeout());
setNettyThreads(oldConf.getNettyThreads());
setThreads(oldConf.getThreads());

相关文章