Skip to content

Commit

Permalink
bugfix: don't publish transaction if it wasn't committed to the database
Browse files Browse the repository at this point in the history
  • Loading branch information
the-avid-engineer committed Nov 24, 2022
1 parent 952ef0e commit 8c7ba5e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/EntityDb.Common/Entities/EntityRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public async Task<TEntity> GetSnapshot(Pointer entityPointer, CancellationToken

public async Task<bool> PutTransaction(ITransaction transaction, CancellationToken cancellationToken = default)
{
try
{
return await TransactionRepository.PutTransaction(transaction, cancellationToken);
}
finally
var success = await TransactionRepository.PutTransaction(transaction, cancellationToken);

if (success)
{
Publish(transaction);
}

return success;
}

public override async ValueTask DisposeAsync()
Expand Down

0 comments on commit 8c7ba5e

Please sign in to comment.