Skip to content

Commit

Permalink
RavenDB-23532 - don't reuse the command
Browse files Browse the repository at this point in the history
  • Loading branch information
grisha-kotler committed Jan 12, 2025
1 parent b32430b commit 8dbca09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Raven.Server/Utils/BackupUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,13 @@ public static void SaveBackupStatus(PeriodicBackupStatus status, string database
{
try
{
var command = new UpdatePeriodicBackupStatusCommand(databaseName, RaftIdGenerator.NewId()) { PeriodicBackupStatus = status };
var raftId = RaftIdGenerator.NewId();

AsyncHelpers.RunSync(async () =>
{
var index = await BackupHelper.RunWithRetriesAsync(maxRetries: 10, async () =>
{
var command = new UpdatePeriodicBackupStatusCommand(databaseName, raftId) { PeriodicBackupStatus = status };
var result = await serverStore.SendToLeaderAsync(command);
return result.Index;
},
Expand Down

0 comments on commit 8dbca09

Please sign in to comment.