Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 91eb748

Browse files
Aaron BoxerAaron Boxer
authored andcommitted
added a few null checks
1 parent 6b4dd4c commit 91eb748

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ServiceStack.Redis/Support/Queue/Implementation/RedisSequentialWorkQueue.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ public void Update(string workItemId, int index, T newWorkItem)
203203
/// <param name="itemCount"></param>
204204
private void Pop(string workItemId, int itemCount)
205205
{
206+
if (itemCount <= 0)
207+
return;
208+
206209
using (var disposableClient = clientManager.GetDisposableClient<SerializingRedisClient>())
207210
{
208211
var client = disposableClient.Client;
@@ -254,7 +257,10 @@ public bool HarvestZombies()
254257
/// <returns>true if lock is released, either by this method or by another client; false otherwise</returns>
255258
public bool TryForceReleaseLock(SerializingRedisClient client, string workItemId)
256259
{
257-
bool rc = false;
260+
if (workItemId == null)
261+
return false;
262+
263+
var rc = false;
258264

259265
var dequeueLockKey = GlobalDequeueLockKey(workItemId);
260266
// handle possibliity of crashed client still holding the lock

0 commit comments

Comments
 (0)