Skip to content

Commit

Permalink
UpdateIAmAlive for SingleMembership fixed to not create invalid subdo…
Browse files Browse the repository at this point in the history
…cuments without required properties
  • Loading branch information
lehoncak-intens authored and wassim-k committed Mar 12, 2024
1 parent cd9d50c commit 0d8b400
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ public async Task<MembershipTableData> ReadRow(string deploymentId, SiloAddress

public async Task UpdateIAmAlive(string deploymentId, SiloAddress address, DateTime iAmAliveTime)
{
await Collection.UpdateOneAsync(x => x.DeploymentId == deploymentId,
Update
var filter = Builders<DeploymentDocument>.Filter.And(
Builders<DeploymentDocument>.Filter.Eq(x => x.DeploymentId, deploymentId),
Builders<DeploymentDocument>.Filter.Exists($"Members.{BuildKey(address)}", true));

await Collection.UpdateOneAsync(filter, Update
.Set($"Members.{BuildKey(address)}.IAmAliveTime", LogFormatter.PrintDate(iAmAliveTime)));
}

Expand Down
2 changes: 1 addition & 1 deletion Orleans.Providers.MongoDB/Orleans.Providers.MongoDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageTags>Orleans OrleansProviders MongoDB</PackageTags>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFrameworks>net8.0</TargetFrameworks>
<Version>8.0.2</Version>
<Version>8.0.3</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 0d8b400

Please sign in to comment.