Skip to content

Commit

Permalink
RavenDB-22659 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
efratshenhar committed Sep 9, 2024
1 parent 7bde229 commit 1e713b0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Raven.Server/Documents/Handlers/QueriesHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ private async Task ExecuteQueryOperation(IndexQueryServerSide query,
Database,
indexName,
operationType,
onProgress => operation(Database.QueryRunner, options, onProgress, token), operationId, details, token);
onProgress => operation(Database.QueryRunner, options, onProgress, token), operationId, details, token: token);

using (ContextPool.AllocateOperationContext(out JsonOperationContext context))
await using (var writer = new AsyncBlittableJsonTextWriter(context, ResponseBodyStream()))
Expand Down
6 changes: 3 additions & 3 deletions src/Raven.Server/Documents/Operations/Operations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public Task<IOperationResult> AddOperation(
Func<Action<IOperationProgress>, Task<IOperationResult>> taskFactory,
long id,
IOperationDetailedDescription detailedDescription = null,
OperationCancelToken token = null,
string databaseName = null)
string resourceName = null,
OperationCancelToken token = null)
{
var operationState = new OperationState
{
Expand Down Expand Up @@ -130,7 +130,7 @@ public Task<IOperationResult> AddOperation(
Description = operationDescription,
Token = token,
State = operationState,
DatabaseName = databaseName
DatabaseName = resourceName
};

object locker = new object();
Expand Down
2 changes: 1 addition & 1 deletion src/Raven.Server/Web/System/AdminDatabasesHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ public async Task RestoreDatabase()
$"Database restore: {restoreBackupTask.RestoreFromConfiguration.DatabaseName}",
Documents.Operations.Operations.OperationType.DatabaseRestore,
taskFactory: onProgress => Task.Run(async () => await restoreBackupTask.Execute(onProgress), cancelToken.Token),
id: operationId, token: cancelToken, databaseName: restoreBackupTask.RestoreFromConfiguration.DatabaseName);
id: operationId, token: cancelToken, resourceName: restoreBackupTask.RestoreFromConfiguration.DatabaseName);

await using (var writer = new AsyncBlittableJsonTextWriter(context, ResponseBodyStream()))
{
Expand Down
2 changes: 1 addition & 1 deletion test/SlowTests/Issues/RavenDB-22659.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public async Task CannotDeleteDatabaseWhenRestoreCancelledOnNonResponsibleNode()

using (var store2 = new DocumentStore { Database = db, Urls = new[] { revivedNode.WebUrl }, Conventions = new DocumentConventions { DisableTopologyUpdates = true } }.Initialize())
{
var val = await WaitForValueAsync(async () => await store2.Maintenance.Server.SendAsync(new GetDatabaseRecordOperation(databaseName)) != null, true);
var val = await WaitForValueAsync(async () => await store2.Maintenance.Server.SendAsync(new GetDatabaseRecordOperation(databaseName)) != null, true, 30_000);
Assert.True(val);

var deleteException = await Assert.ThrowsAsync<RavenException>(async () =>
Expand Down

0 comments on commit 1e713b0

Please sign in to comment.