aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-12-26 20:55:55 -0600
committerJP Dillingham <jp@dillingham.me>2023-12-26 20:55:55 -0600
commitbb2f31e9a6f82763d1146c7b64a643192a5ab775 (patch)
tree754a9996fa7d74ca658f288fa3a187456af9559e
parent2ab48b5c90f902c552782d62212ddf72d5aa7118 (diff)
downloadslskd-bb2f31e9a6f82763d1146c7b64a643192a5ab775.tar.gz
add cache retention option
-rw-r--r--config/slskd.example.yml1
-rw-r--r--src/slskd/Core/Options.cs9
2 files changed, 10 insertions, 0 deletions
diff --git a/config/slskd.example.yml b/config/slskd.example.yml
index fe693fd9..9cce2ddb 100644
--- a/config/slskd.example.yml
+++ b/config/slskd.example.yml
@@ -43,6 +43,7 @@
# cache:
# storage_mode: memory
# workers: 16
+# retention: ~ # retain indefinitely (do not automatically re-scan)
# rooms:
# - ~
# global:
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 077ecf74..94f8618d 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -752,6 +752,15 @@ namespace slskd
[Range(1, 128)]
[RequiresRestart]
public int Workers { get; init; } = Environment.ProcessorCount;
+
+ /// <summary>
+ /// Gets the time to retain the cache (the interval on which to re-scan automatically), in minutes.
+ /// </summary>
+ [Argument(default, "share-cache-retention")]
+ [EnvironmentVariable("SHARE_CACHE_RETENTION")]
+ [Description("the time to retain the cache (re-scan interval), in minutes")]
+ [Range(60, int.MaxValue)]
+ public int? Retention { get; init; } = null;
}
}