From 52c2dc92b8a7588f79397e8c01eb085b5e7bf82a Mon Sep 17 00:00:00 2001 From: Andy Wu Date: Thu, 9 May 2024 00:39:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E9=87=8D=E5=86=99AcquireLock?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3FullRedis=E4=B8=ADAcquireLock?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E5=89=8D=E7=BC=80=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NewLife.Core/Caching/Cache.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewLife.Core/Caching/Cache.cs b/NewLife.Core/Caching/Cache.cs index 9f22ad6ec..d527107ed 100644 --- a/NewLife.Core/Caching/Cache.cs +++ b/NewLife.Core/Caching/Cache.cs @@ -281,7 +281,7 @@ public virtual Double Decrement(String key, Double value) /// 要锁定的key /// 锁等待时间,单位毫秒 /// - public IDisposable? AcquireLock(String key, Int32 msTimeout) + public virtual IDisposable? AcquireLock(String key, Int32 msTimeout) { var rlock = new CacheLock(this, key); if (!rlock.Acquire(msTimeout, msTimeout)) throw new InvalidOperationException($"Lock [{key}] failed! msTimeout={msTimeout}"); @@ -295,7 +295,7 @@ public virtual Double Decrement(String key, Double value) /// 锁过期时间,超过该时间如果没有主动释放则自动释放锁,必须整数秒,单位毫秒 /// 失败时是否抛出异常,如果不抛出异常,可通过返回null得知申请锁失败 /// - public IDisposable? AcquireLock(String key, Int32 msTimeout, Int32 msExpire, Boolean throwOnFailure) + public virtual IDisposable? AcquireLock(String key, Int32 msTimeout, Int32 msExpire, Boolean throwOnFailure) { var rlock = new CacheLock(this, key); if (!rlock.Acquire(msTimeout, msExpire))