From b1216d27596da6f14c851ece48f9eccf1c255d57 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Sat, 28 Jan 2023 06:36:51 -0600 Subject: [PATCH] adding a systemd timer for photoprism indexing every 15 min --- system/shen/configuration.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/system/shen/configuration.nix b/system/shen/configuration.nix index 301ede0..ed94b9d 100644 --- a/system/shen/configuration.nix +++ b/system/shen/configuration.nix @@ -241,6 +241,13 @@ ExecStart = "${pkgs.docker}/bin/docker exec -u www-data -d nextcloud-app-1 php occ preview:pre-generate"; }; }; + photoprism-index = { + enable = true; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.docker}/bin/docker exec -it photoprism-photoprism-1 photoprism index"; + } + } }; systemd.timers = { @@ -263,6 +270,16 @@ }; wantedBy = [ "timers.target" ]; }; + photoprism-index = { + enable = true; + partOf = ["photoprism-index.service"]; + timerConfig = { + OnStartupSec = "2min"; + OnUnitActiveSec = "15min"; + Unit = "photoprism-index.service"; + }; + wantedBy = [ "timers.target" ]; + }; }; # Open ports in the firewall.