From 03975b7caff4edc8f413bda52fc811220770bd90 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Wed, 14 Feb 2018 22:38:20 +0100
Subject: [PATCH] Make GracePeriod optional, defaulting to 30 days.

Refers to #29
---
 ATxCommon/Serializables/ServiceConfig.cs | 13 +++++++------
 Resources/conf/config.common.xml         |  8 ++++----
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/ATxCommon/Serializables/ServiceConfig.cs b/ATxCommon/Serializables/ServiceConfig.cs
index d5bf069..12f8052 100644
--- a/ATxCommon/Serializables/ServiceConfig.cs
+++ b/ATxCommon/Serializables/ServiceConfig.cs
@@ -41,12 +41,6 @@ namespace ATxCommon.Serializables
         /// </summary>
         public string ManagedDirectory { get; set; }
 
-        /// <summary>
-        /// GracePeriod: number of days after data in the "DONE" location expires,
-        /// which will trigger a summary email to the admin address.
-        /// </summary>
-        public int GracePeriod { get; set; }
-
         /// <summary>
         /// A human friendly name for the target, to be used in emails etc.
         /// </summary>
@@ -161,6 +155,12 @@ namespace ATxCommon.Serializables
         /// </summary>
         public int StorageNotificationDelta { get; set; }
 
+        /// <summary>
+        /// GracePeriod: number of days after data in the "DONE" location expires,
+        /// which will trigger a summary email to the admin address, default: 30.
+        /// </summary>
+        public int GracePeriod { get; set; }
+
         /// <summary>
         /// A list of process names causing transfers to be suspended if running.
         /// </summary>
@@ -249,6 +249,7 @@ namespace ATxCommon.Serializables
             AdminNotificationDelta = 60;
             GraceNotificationDelta = 720;
             StorageNotificationDelta = 720;
+            GracePeriod = 30;
             // BlacklistedProcesses may be empty
             EnforceInheritedACLs = true;
             // SpaceMonitoring may be empty
diff --git a/Resources/conf/config.common.xml b/Resources/conf/config.common.xml
index fe28063..c985d94 100644
--- a/Resources/conf/config.common.xml
+++ b/Resources/conf/config.common.xml
@@ -11,10 +11,6 @@
          the transfer (sub-directory "DONE"). -->
     <ManagedDirectory>ATX\MANAGED</ManagedDirectory>
 
-    <!-- GracePeriod: number of days after data in the "DONE" location expires,
-         which will trigger a summary email to the admin address. -->
-    <GracePeriod>30</GracePeriod>
-
     <!-- DestinationAlias: friendly name for the target to be used in mails -->
     <DestinationAlias>Core Facility Storage</DestinationAlias>
 
@@ -85,6 +81,10 @@
          in case one of the drives is below the threshold (in minutes) -->
     <StorageNotificationDelta>720</StorageNotificationDelta>
 
+    <!-- GracePeriod: number of days after data in the "DONE" location expires,
+         which will trigger a summary email to the admin address. -->
+    <GracePeriod>30</GracePeriod>
+
     <!-- BlacklistedProcesses: a list of "ProcessName" entries denoting
          programs that will cause a transfer to be suspended immediately if the
          name is found in the list of running processes -->
-- 
GitLab