Add cleanup thread, use systemd directories

This commit is contained in:
2023-01-07 12:38:14 -08:00
parent 3ea26dd9f2
commit 46e0801931
3 changed files with 61 additions and 3 deletions
+17
View File
@@ -35,6 +35,21 @@ in {
"List of IP addresses on which to listen for incoming requests.";
default = [ "127.0.0.1" ];
};
cleanup = {
max_file_age = mkOption {
type = int;
description =
"Maximum age of a file (in seconds), after which it will be removed.";
default = 60 * 60 * 8; # 8 hours
};
delay = {
type = int;
description = "Time between cleanup sweeps.";
default = 60 * 10; # 10 minutes
};
};
};
config = mkIf cfg.enable {
@@ -48,6 +63,8 @@ in {
OBJECTIFIER_YOLOV3_WEIGHTS = "${pkgs.yolov3-data}/yolov3.weights";
OBJECTIFIER_YOLOV3_LABELS = "${pkgs.yolov3-data}/labels";
OBJECTIFIER_BUFFER_SIZE = "524288";
OBJECTIFIER_CLEANUP_MAX_AGE = toString cfg.cleanup.max_file_age;
OBJECTIFIER_CLEANUP_DELAY = toString cfg.cleanup.delay;
};
serviceConfig = {
# PrivateUsers = true;