Files
git.stella-ops.org/src/__Libraries/StellaOps.Artifact.Infrastructure/ArtifactMigrationService.Batch.cs

34 lines
1.1 KiB
C#

// -----------------------------------------------------------------------------
// ArtifactMigrationService.Batch.cs
// Sprint: SPRINT_20260118_017_Evidence_artifact_store_unification
// Task: AS-006 - Migrate existing evidence to unified store
// Description: Batch execution helpers for artifact migration
// -----------------------------------------------------------------------------
namespace StellaOps.Artifact.Infrastructure;
public sealed partial class ArtifactMigrationService
{
private async Task<ArtifactMigrationResult> QueueMigrationAsync(
LegacyArtifact legacy,
SemaphoreSlim semaphore,
CancellationToken ct)
{
await semaphore.WaitAsync(ct).ConfigureAwait(false);
try
{
return await MigrateOneAsync(legacy, ct).ConfigureAwait(false);
}
finally
{
semaphore.Release();
}
}
private static async Task<IReadOnlyList<ArtifactMigrationResult>> ProcessBatchAsync(
List<Task<ArtifactMigrationResult>> batch)
{
var results = await Task.WhenAll(batch).ConfigureAwait(false);
return results;
}
}