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

Make expiry threshold a parameter of GraceLocationSummary().

Refers to #1
parent 4c240b6b
Branches
Tags
No related merge requests found
...@@ -215,7 +215,7 @@ namespace AutoTx ...@@ -215,7 +215,7 @@ namespace AutoTx
msg += "\n------ Grace location status ------\n"; msg += "\n------ Grace location status ------\n";
try { try {
msg += GraceLocationSummary(); msg += GraceLocationSummary(_config.GracePeriod);
} }
catch (Exception ex) { catch (Exception ex) {
writeLog("CheckGraceLocation() failed: " + ex.Message, true); writeLog("CheckGraceLocation() failed: " + ex.Message, true);
...@@ -921,7 +921,7 @@ namespace AutoTx ...@@ -921,7 +921,7 @@ namespace AutoTx
} }
public void CheckGraceLocation() { public void CheckGraceLocation() {
writeLogDebug(GraceLocationSummary()); writeLogDebug(GraceLocationSummary(_config.GracePeriod));
} }
/// <summary> /// <summary>
...@@ -931,8 +931,9 @@ namespace AutoTx ...@@ -931,8 +931,9 @@ 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 string GraceLocationSummary() { /// <param name="threshold">The number of days used as expiration threshold.</param>
var expired = ExpiredDirs(_config.GracePeriod); public string GraceLocationSummary(int threshold) {
var expired = ExpiredDirs(threshold);
var report = ""; var report = "";
foreach (var userdir in expired.Keys) { foreach (var userdir in expired.Keys) {
report += "\n - user '" + userdir + "'\n"; report += "\n - user '" + userdir + "'\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment