Skip to content

Commit 7eb55a2

Browse files
Spacefishperrich
authored andcommitted
use proper hangfire exception for distibuted lock timeout
1 parent 3c76be5 commit 7eb55a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Hangfire.MemoryStorage/MemoryStorageConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public override IDisposable AcquireDistributedLock(string resource, TimeSpan tim
3333
// try to acquire an existing lock or create a new one if none exists for the resource
3434
// in case of an timeout throw a SynchronizationLockException
3535
if(!_locks.GetOrAdd(resource, new SemaphoreSlim(1)).Wait(timeout))
36-
throw new SynchronizationLockException();
36+
throw new DistributedLockTimeoutException(resource);
3737

3838
// return an IDisposable that releases the lock when disposed
3939
return Disposable.Create(() =>

0 commit comments

Comments
 (0)