fix(reconcile): heal all concurrently-missing nodes — return existing pending token instead of omitting
This commit is contained in:
+13
@@ -226,6 +226,19 @@ public class DeploymentManagerRepository : IDeploymentManagerRepository
|
||||
.FirstOrDefaultAsync(p => p.DeploymentId == deploymentId, cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<PendingDeployment?> GetPendingDeploymentByInstanceIdAsync(int instanceId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
// At most one pending row per instance by design (supersession + stage-if-absent),
|
||||
// but order deterministically and take the most recent so a hypothetical duplicate
|
||||
// never makes the read non-deterministic — mirrors GetCurrentDeploymentStatusAsync.
|
||||
return _dbContext.Set<PendingDeployment>()
|
||||
.Where(p => p.InstanceId == instanceId)
|
||||
.OrderByDescending(p => p.CreatedAtUtc)
|
||||
.ThenByDescending(p => p.Id)
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DeletePendingDeploymentByIdAsync(string deploymentId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user