aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/Options.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-09-18 08:46:09 -0500
committerGitHub <noreply@github.com>2023-09-18 08:46:09 -0500
commit77ec3da43c11449d2d4ae64c1413505f7a7741a2 (patch)
tree3eb7d438339be0b7e7b8ef2ded969231422d26fa /src/slskd/Core/Options.cs
parenta505a5ee4072d0f50e747e05e1f4b1de86f4c396 (diff)
parent4cdefceae542f59de2d55ffcafc03f2af5edfcc9 (diff)
downloadslskd-77ec3da43c11449d2d4ae64c1413505f7a7741a2.tar.gz
Merge pull request #972 from slskd/scheduler
Add retention settings for transfers, check for 'expired' transfers on a 5 minute interval and remove (soft delete) them
Diffstat (limited to 'src/slskd/Core/Options.cs')
-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..30297cac 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(5, maximum: int.MaxValue)]
+ public int? Succeeded { get; init; } = null;
+
+ /// <summary>
+ /// Gets the time to retain errored transfers, in minutes.
+ /// </summary>
+ [Range(5, maximum: int.MaxValue)]
+ public int? Errored { get; init; } = null;
+
+ /// <summary>
+ /// Gets the time to retain cancelled transfers, in minutes.
+ /// </summary>
+ [Range(5, maximum: int.MaxValue)]
+ public int? Cancelled { get; init; } = null;
+ }
+ }
+
+ /// <summary>
/// Metrics options.
/// </summary>
public class MetricsOptions