longrun: don't add logger if producer-for is already set

This commit is contained in:
Daniel Barlow 2024-10-06 13:13:04 +01:00
parent ba03ddeb38
commit b9999857cb
1 changed files with 5 additions and 3 deletions

View File

@ -53,6 +53,7 @@ let
, run , run
, notification-fd ? null , notification-fd ? null
, buildInputs ? [] , buildInputs ? []
, producer-for ? null
, ... , ...
} @ args: } @ args:
let logger = service { let logger = service {
@ -64,11 +65,11 @@ let
pipeline-name = "${name}-pipeline"; pipeline-name = "${name}-pipeline";
}; };
in service (args // { in service (args // {
buildInputs = buildInputs ++ [ logger ]; buildInputs = buildInputs ++ lib.optional (producer-for == null) logger;
serviceType = "longrun"; serviceType = "longrun";
run = serviceScript run; run = serviceScript run;
finish = cleanupScript name; finish = cleanupScript name;
producer-for = "${name}-log"; producer-for = if producer-for != null then producer-for else "${name}-log";
}); });
oneshot = { oneshot = {
@ -92,5 +93,6 @@ let
}); });
target = bundle; target = bundle;
in { in {
inherit target bundle oneshot longrun output; inherit target bundle oneshot output;
longrun = lib.makeOverridable longrun;
} }