Skip to content

Commit

Permalink
Added nolock to get postponed functions sql in SqlServerFunctionStore
Browse files Browse the repository at this point in the history
  • Loading branch information
stidsborg committed Aug 13, 2024
1 parent 9d733ed commit 0f705f3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public async Task<IReadOnlyList<InstanceAndEpoch>> 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";
Expand All @@ -342,7 +342,7 @@ public async Task<IReadOnlyList<InstanceAndEpoch>> GetPostponedFunctions(FlowTyp
}

private string? _getSucceededFunctionsSql;
public async Task<IReadOnlyList<FlowInstance>> GetSucceededFunctions(FlowType FlowType, long completedBefore)
public async Task<IReadOnlyList<FlowInstance>> GetSucceededFunctions(FlowType flowType, long completedBefore)
{
await using var conn = await _connFunc();
_getSucceededFunctionsSql ??= @$"
Expand All @@ -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();
Expand Down

0 comments on commit 0f705f3

Please sign in to comment.