2881099 / FreeRedis

🦄 FreeRedis is .NET40+ redis client. supports cluster, sentinel, master-slave, pub-sub, lua, pipeline, transaction, streams, client-side-caching, and pooling.
MIT License
920 stars 164 forks source link

需求:关于分布式锁的改进建议 #169

Open hd2y opened 10 months ago

hd2y commented 10 months ago

需求来自于微信群。

LockController ,我有两个提议,一个是支持 CancellationToken

另一个是增加 waitTimeoutSecond。

等待时间和刷新时间分开。

使用时,如果 waitTimeoutSecond 时间结束没有获取到锁,则失败返回。

而 timeoutSeconds 用于刷新时间 @whuanle

2881099 commented 10 months ago

建议pr

Naughtyhusky commented 9 months ago

得嘞,我也遇见这个问题了,设置的锁自动过期时间是5分钟。然后程序在尝试获取锁的时候,就在那等了五分钟......

whuanle commented 9 months ago

新版本解决了这个问题

---原始邮件--- 发件人: @.> 发送时间: 2024年1月4日(周四) 下午2:24 收件人: @.>; 抄送: @.**@.>; 主题: Re: [2881099/FreeRedis] 需求:关于分布式锁的改进建议 (Issue #169)

得嘞,我也遇见这个问题了,设置的锁自动过期时间是5分钟。然后程序在尝试获取锁的时候,就在那等了五分钟......

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>