Skip to content

Commit 061ba55

Browse files
committed
remove unnecessary checks
1 parent f0be16f commit 061ba55

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/ServiceControl.Audit.Persistence.RavenDB/CustomChecks/CheckFreeDiskSpace.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ class CheckFreeDiskSpace(DatabaseConfiguration databaseConfiguration, ILogger<Ch
1313
{
1414
public override Task<CheckResult> PerformCheck(CancellationToken cancellationToken = default)
1515
{
16-
if (logger.IsEnabled(LogLevel.Debug))
17-
{
18-
logger.LogDebug("Check ServiceControl data drive space remaining custom check starting. Threshold {PercentageThreshold:P0}", percentageThreshold);
19-
}
16+
logger.LogDebug("Check ServiceControl data drive space remaining custom check starting. Threshold {PercentageThreshold:P0}", percentageThreshold);
2017

2118
if (!databaseConfiguration.ServerConfiguration.UseEmbeddedServer)
2219
{
@@ -33,11 +30,7 @@ public override Task<CheckResult> PerformCheck(CancellationToken cancellationTok
3330
var totalSpace = (decimal)dataDriveInfo.TotalSize;
3431

3532
var percentRemaining = (decimal)dataDriveInfo.AvailableFreeSpace / dataDriveInfo.TotalSize;
36-
37-
if (logger.IsEnabled(LogLevel.Debug))
38-
{
39-
logger.LogDebug("Free space: {AvailableFreeSpace:N0}B | Total: {TotalSpace:N0}B | Percent remaining {PercentRemaining:P1}", availableFreeSpace, totalSpace, percentRemaining);
40-
}
33+
logger.LogDebug("Free space: {AvailableFreeSpace:N0}B | Total: {TotalSpace:N0}B | Percent remaining {PercentRemaining:P1}", availableFreeSpace, totalSpace, percentRemaining);
4134

4235
return percentRemaining > percentageThreshold
4336
? CheckResult.Pass

0 commit comments

Comments
 (0)