adding a systemd timer for photoprism indexing every 15 min

This commit is contained in:
Chris Cochrun 2023-01-28 06:36:51 -06:00
parent 7588ff250a
commit b1216d2759

View file

@ -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.