diff --git a/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs b/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs index a1a98b86d9..18705af5b9 100644 --- a/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs +++ b/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs @@ -23,9 +23,9 @@ public override Task PerformCheck(CancellationToken cancellationTok return CheckResult.Pass; } - if (dataPathRoot == null) + if (dataPathRoot is null) { - throw new Exception($"Unable to find the root of the data path {dataPathRoot}"); + throw new Exception($"Unable to find the root of the data path {databaseConfiguration.ServerConfiguration.DbPath}"); } var dataDriveInfo = new DriveInfo(dataPathRoot); diff --git a/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs b/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs index 4204b6d29e..e3803e5c3b 100644 --- a/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs +++ b/src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs @@ -15,8 +15,8 @@ public CheckMinimumStorageRequiredForIngestion(MinimumRequiredStorageState state { this.stateHolder = stateHolder; this.databaseConfiguration = databaseConfiguration; - percentageThreshold = this.databaseConfiguration.MinimumStorageLeftRequiredForIngestion / 100m; dataPathRoot = Path.GetPathRoot(databaseConfiguration.ServerConfiguration.DbPath); + percentageThreshold = this.databaseConfiguration.MinimumStorageLeftRequiredForIngestion / 100m; } public override Task PerformCheck(CancellationToken cancellationToken = default) @@ -32,9 +32,9 @@ public override Task PerformCheck(CancellationToken cancellationTok return CheckResult.Pass; } - if (dataPathRoot == null) + if (dataPathRoot is null) { - throw new Exception($"Unable to find the root of the data path {dataPathRoot}"); + throw new Exception($"Unable to find the root of the data path {databaseConfiguration.ServerConfiguration.DbPath}"); } var dataDriveInfo = new DriveInfo(dataPathRoot); diff --git a/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs b/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs index 0047a7ac35..c90bce9807 100644 --- a/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs +++ b/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs @@ -22,9 +22,9 @@ public override Task PerformCheck(CancellationToken cancellationTok return CheckResult.Pass; } - if (dataPathRoot == null) + if (dataPathRoot is null) { - throw new Exception($"Unable to find the root of the data path {dataPathRoot}"); + throw new Exception($"Unable to find the root of the data path {settings.DatabasePath}"); } var dataDriveInfo = new DriveInfo(dataPathRoot); diff --git a/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs b/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs index edde4d3ea8..69245774ab 100644 --- a/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs +++ b/src/ServiceControl.Persistence.RavenDB/CustomChecks/CheckMinimumStorageRequiredForIngestion.cs @@ -32,9 +32,9 @@ public override Task PerformCheck(CancellationToken cancellationTok return SuccessResult; } - if (dataPathRoot == null) + if (dataPathRoot is null) { - throw new Exception($"Unable to find the root of the data path {dataPathRoot}"); + throw new Exception($"Unable to find the root of the data path {settings.DatabasePath}"); } var dataDriveInfo = new DriveInfo(dataPathRoot);