Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ class RetryHistoryDataStore(IRavenSessionProvider sessionProvider) : IRetryHisto
public async Task<RetryHistory> GetRetryHistory()
{
using var session = await sessionProvider.OpenSession();
var id = DocumentId;
var retryHistory = await session.LoadAsync<RetryHistory>(id);
var retryHistory = await session.LoadAsync<RetryHistory>(DocumentId);

retryHistory ??= new() { Id = DocumentId };
retryHistory ??= new();

return retryHistory;
}
Expand All @@ -23,7 +22,7 @@ public async Task RecordRetryOperationCompleted(string requestId, RetryType retr
string originator, string classifier, bool messageFailed, int numberOfMessagesProcessed, DateTime lastProcessed, int retryHistoryDepth)
{
using var session = await sessionProvider.OpenSession();
var retryHistory = await session.LoadAsync<RetryHistory>(DocumentId) ?? new() { Id = DocumentId };
var retryHistory = await session.LoadAsync<RetryHistory>(DocumentId) ?? new();

retryHistory.AddToUnacknowledged(new UnacknowledgedRetryOperation
{
Expand All @@ -49,7 +48,7 @@ public async Task RecordRetryOperationCompleted(string requestId, RetryType retr
NumberOfMessagesProcessed = numberOfMessagesProcessed
}, retryHistoryDepth);

await session.StoreAsync(retryHistory);
await session.StoreAsync(retryHistory, DocumentId);
await session.SaveChangesAsync();
}

Expand All @@ -61,7 +60,7 @@ public async Task<bool> AcknowledgeRetryGroup(string groupId)
{
if (retryHistory.Acknowledge(groupId, RetryType.FailureGroup))
{
await session.StoreAsync(retryHistory);
await session.StoreAsync(retryHistory, DocumentId);
await session.SaveChangesAsync();

return true;
Expand Down
1 change: 0 additions & 1 deletion src/ServiceControl.Persistence/RetryHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

public class RetryHistory
{
public string Id { get; set; }
public List<HistoricRetryOperation> HistoricOperations { get; set; } = [];
public List<UnacknowledgedRetryOperation> UnacknowledgedOperations { get; set; } = [];

Expand Down
Loading