Skip to content
Snippets Groups Projects
Commit 9c75a68b authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Turn CheckGraceLocation() into a wrapper for GraceLocationSummary().

Refers to #1
parent edd17c7f
No related branches found
No related tags found
No related merge requests found
...@@ -922,6 +922,10 @@ namespace AutoTx ...@@ -922,6 +922,10 @@ namespace AutoTx
.Sum(file => file.Length); .Sum(file => file.Length);
} }
public void CheckGraceLocation() {
writeLogDebug(GraceLocationSummary());
}
/// <summary> /// <summary>
/// Generate a report on expired folders in the grace location. /// Generate a report on expired folders in the grace location.
/// ///
...@@ -929,7 +933,7 @@ namespace AutoTx ...@@ -929,7 +933,7 @@ namespace AutoTx
/// name-timestamp exceeds the configured grace period and generate a summary /// name-timestamp exceeds the configured grace period and generate a summary
/// containing the age and size of those directories. /// containing the age and size of those directories.
/// </summary> /// </summary>
public void CheckGraceLocation() { public string GraceLocationSummary() {
var expired = ExpiredDirs(_config.GracePeriod); var expired = ExpiredDirs(_config.GracePeriod);
var report = ""; var report = "";
foreach (var userdir in expired.Keys) { foreach (var userdir in expired.Keys) {
...@@ -939,7 +943,9 @@ namespace AutoTx ...@@ -939,7 +943,9 @@ namespace AutoTx
subdir.Item1, subdir.Item2, subdir.Item3); subdir.Item1, subdir.Item2, subdir.Item3);
} }
} }
writeLogDebug("Expired folders in grace location:\n" + report); if (string.IsNullOrEmpty(report))
return "No expired folders in grace location.\n";
return "Expired folders in grace location:\n" + report;
} }
/// <summary> /// <summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment