From 0f705f35f3b0842449b596b259b028f3e6663264 Mon Sep 17 00:00:00 2001 From: stidsborg Date: Tue, 13 Aug 2024 21:43:42 +0200 Subject: [PATCH] Added nolock to get postponed functions sql in SqlServerFunctionStore --- .../SqlServerFunctionStore.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Stores/SqlServer/Cleipnir.ResilientFunctions.SqlServer/SqlServerFunctionStore.cs b/Stores/SqlServer/Cleipnir.ResilientFunctions.SqlServer/SqlServerFunctionStore.cs index b55c59fe..7a006d3e 100644 --- a/Stores/SqlServer/Cleipnir.ResilientFunctions.SqlServer/SqlServerFunctionStore.cs +++ b/Stores/SqlServer/Cleipnir.ResilientFunctions.SqlServer/SqlServerFunctionStore.cs @@ -315,7 +315,7 @@ public async Task> GetPostponedFunctions(FlowTyp await using var conn = await _connFunc(); _getPostponedFunctionsSql ??= @$" SELECT flowInstance, Epoch - FROM {_tablePrefix} + FROM {_tablePrefix} WITH (NOLOCK) WHERE FlowType = @FlowType AND Status = {(int) Status.Postponed} AND PostponedUntil <= @PostponedUntil"; @@ -342,7 +342,7 @@ public async Task> GetPostponedFunctions(FlowTyp } private string? _getSucceededFunctionsSql; - public async Task> GetSucceededFunctions(FlowType FlowType, long completedBefore) + public async Task> GetSucceededFunctions(FlowType flowType, long completedBefore) { await using var conn = await _connFunc(); _getSucceededFunctionsSql ??= @$" @@ -353,7 +353,7 @@ SELECT flowInstance AND Timestamp <= @CompletedBefore"; await using var command = new SqlCommand(_getSucceededFunctionsSql, conn); - command.Parameters.AddWithValue("@FlowType", FlowType.Value); + command.Parameters.AddWithValue("@FlowType", flowType.Value); command.Parameters.AddWithValue("@CompletedBefore", completedBefore); await using var reader = await command.ExecuteReaderAsync();