aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-09-16 22:54:16 -0500
committerJP Dillingham <jp@dillingham.me>2023-09-16 22:54:16 -0500
commitcf5a29422198e4defc3820edf8b160f9bcd00857 (patch)
tree47b212bcbde9819f7cbead665832d00e3b6215ba /src
parent3444f90198d3e0125717f2a459bd3b4a021cebbc (diff)
downloadslskd-cf5a29422198e4defc3820edf8b160f9bcd00857.tar.gz
add retention options
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Options.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 2ee21733..b2c85146 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -254,6 +254,12 @@ namespace slskd
public WebOptions Web { get; init; } = new WebOptions();
/// <summary>
+ /// Gets retention options.
+ /// </summary>
+ [Validate]
+ public RetentionOptions Retention { get; init; } = new RetentionOptions();
+
+ /// <summary>
/// Gets logger options.
/// </summary>
[Validate]
@@ -1049,6 +1055,48 @@ namespace slskd
}
/// <summary>
+ /// Retention options.
+ /// </summary>
+ public class RetentionOptions
+ {
+ /// <summary>
+ /// Gets upload retention options.
+ /// </summary>
+ [Validate]
+ public TransferRetentionOptions Upload { get; init; } = new TransferRetentionOptions();
+
+ /// <summary>
+ /// Gets download retention options.
+ /// </summary>
+ [Validate]
+ public TransferRetentionOptions Download { get; init; } = new TransferRetentionOptions();
+
+ /// <summary>
+ /// Transfer retention options.
+ /// </summary>
+ public class TransferRetentionOptions
+ {
+ /// <summary>
+ /// Gets the time to retain successful transfers, in minutes.
+ /// </summary>
+ [Range(60, maximum: int.MaxValue)]
+ public int Succeeded { get; init; } = int.MaxValue;
+
+ /// <summary>
+ /// Gets the time to retain errored transfers, in minutes.
+ /// </summary>
+ [Range(60, maximum: int.MaxValue)]
+ public int Errored { get; init; } = int.MaxValue;
+
+ /// <summary>
+ /// Gets the time to retain cancelled transfers, in minutes.
+ /// </summary>
+ [Range(60, maximum: int.MaxValue)]
+ public int Cancelled { get; init; } = int.MaxValue;
+ }
+ }
+
+ /// <summary>
/// Metrics options.
/// </summary>
public class MetricsOptions