nixos/immich: only start after reaching postgres.target
Without this dependency, we may run into a race condition, especially in our tests. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@@ -335,7 +335,8 @@ in
|
||||
|
||||
systemd.services.immich-server = {
|
||||
description = "Immich backend server (Self-hosted photo and video backup solution)";
|
||||
after = [ "network.target" ];
|
||||
requires = lib.mkIf cfg.database.enable [ "postgresql.target" ];
|
||||
after = [ "network.target" ] ++ lib.optionals cfg.database.enable [ "postgresql.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
inherit (cfg) environment;
|
||||
path = [
|
||||
@@ -362,7 +363,8 @@ in
|
||||
|
||||
systemd.services.immich-machine-learning = mkIf cfg.machine-learning.enable {
|
||||
description = "immich machine learning";
|
||||
after = [ "network.target" ];
|
||||
requires = lib.mkIf cfg.database.enable [ "postgresql.target" ];
|
||||
after = [ "network.target" ] ++ lib.optionals cfg.database.enable [ "postgresql.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
inherit (cfg.machine-learning) environment;
|
||||
serviceConfig = commonServiceConfig // {
|
||||
|
||||
Reference in New Issue
Block a user