Skip to content

Commit

Permalink
fix: Resume session should complete task insertion into the queue
Browse files Browse the repository at this point in the history
  • Loading branch information
aneojgurhem committed Nov 28, 2024
1 parent 2e55acc commit 8d9671e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Common/src/Storage/TaskLifeCycleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,18 +535,20 @@ public static async Task<SessionData> ResumeAsync(ITaskTable taskTable,
cancellationToken)
.ConfigureAwait(false))
{
cancellationToken.ThrowIfCancellationRequested();

var taskIds = tasks.Select(task => task.TaskId)
.AsICollection();

await taskTable.UpdateManyTasks(data => data.SessionId == sessionId && data.Status == TaskStatus.Paused && taskIds.Contains(data.TaskId),
new UpdateDefinition<TaskData>().Set(data => data.Status,
TaskStatus.Submitted),
cancellationToken)
CancellationToken.None)
.ConfigureAwait(false);

await pushQueueStorage.PushMessagesAsync(tasks,
grouping.Key.PartitionId,
cancellationToken)
CancellationToken.None)
.ConfigureAwait(false);
}
}
Expand Down

0 comments on commit 8d9671e

Please sign in to comment.