Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
vplauzon committed Sep 14, 2024
1 parent 0f88b91 commit 47b1857
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ public IImmutableList<string> GetOperationIds()
}
}

public RowItem RemoveBlockItem(string operationId)
{
lock (_operationIdToBlockMap)
{
var blockItem = _operationIdToBlockMap[operationId];

_operationIdToBlockMap.Remove(operationId);

return blockItem;
}
}

public void AddOperationId(RowItem blockItem)
{
lock (_operationIdToBlockMap)
Expand Down Expand Up @@ -460,7 +472,13 @@ private async Task OnExportedAsync(CancellationToken ct)
switch (status.State)
{
case "Completed":
throw new NotSupportedException();
var blockItem = clusterQueue.RemoveBlockItem(status.OperationId)
.Clone();

blockItem.State = SourceBlockState.Exported.ToString();
await RowItemGateway.AppendAsync(blockItem, ct);

break;
case "Failed":
throw new CopyException(
$"Failed export '{status.OperationId}': '{status.Status}'",
Expand Down

0 comments on commit 47b1857

Please sign in to comment.