Skip to content

Commit

Permalink
task run not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
thelonelyvulpes committed May 12, 2022
1 parent deae0c5 commit e7508e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Neo4j.Driver/Neo4j.Driver/Internal/AsyncQueryRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ protected virtual void Dispose(bool disposing)

public async ValueTask DisposeAsync()
{
await DisposeAsyncCore();
await DisposeAsyncCore().ConfigureAwait(false);

Dispose(disposing: false);
GC.SuppressFinalize(this);
}

protected virtual async ValueTask DisposeAsyncCore()
protected virtual ValueTask DisposeAsyncCore()
{
//Nothing to dispose of in this class. Methods required for derived classes and correct dispose pattern
await Task.CompletedTask;
return new ValueTask(Task.CompletedTask);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Neo4j.Driver/Neo4j.Driver/Internal/AsyncSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected override void Dispose(bool disposing)
//Dispose managed resources

//call it synchronously
Task.Run(CloseAsync).GetAwaiter().GetResult();
CloseAsync().GetAwaiter().GetResult();
}

_disposed = true;
Expand Down

0 comments on commit e7508e2

Please sign in to comment.