feat(django-apps): Add timers option
Some checks failed
Build all the nodes / netcore01 (push) Successful in 20s
Build all the nodes / netaccess01 (push) Successful in 21s
Build all the nodes / netcore02 (push) Successful in 20s
Build all the nodes / ap01 (push) Successful in 58s
Build all the nodes / geo02 (push) Successful in 1m32s
Build all the nodes / rescue01 (push) Failing after 1m36s
Build all the nodes / geo01 (push) Successful in 2m8s
Build all the nodes / compute01 (push) Failing after 2m17s
Build all the nodes / hypervisor03 (push) Successful in 2m17s
Build all the nodes / hypervisor02 (push) Successful in 2m19s
Build all the nodes / hypervisor01 (push) Successful in 2m23s
Build all the nodes / bridge01 (push) Successful in 2m23s
Build all the nodes / tower01 (push) Successful in 2m22s
Build all the nodes / storage01 (push) Successful in 2m23s
Build all the nodes / build01 (push) Successful in 2m29s
Build all the nodes / web03 (push) Failing after 56s
Build the shell / build-shell (push) Successful in 25s
Build all the nodes / web02 (push) Successful in 1m37s
Run pre-commit on all files / pre-commit (push) Successful in 24s
Build all the nodes / vault01 (push) Successful in 2m23s
Build all the nodes / web01 (push) Successful in 2m39s

This is similar to extraServices but without the partOf, upheldBy and
wantedBy settings.
This commit is contained in:
Tom Hubrecht 2025-02-24 16:03:01 +01:00
parent 80ede4b1f6
commit 09ffafade0
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -322,6 +322,15 @@ in
Extra services to run in parallel of the application.
May be used to run background tasks and/or workers.
'';
timers = mkOption {
type = attrs;
default = { };
description = ''
Extra oneshot services to run in parallel of the application.
Be aware that `startAt` should be included.
'';
};
};
manageScript = mkOption {
@ -805,6 +814,28 @@ in
} serviceContent
)
) config.extraServices)
// (mapAttrs' (
serviceName: serviceContent:
nameValuePair "dj-${name}_${serviceName}" (
recursiveUpdate {
inherit after environment path;
serviceConfig = {
inherit
Group
LoadCredential
RuntimeDirectory
StateDirectory
UMask
User
;
WorkingDirectory = "/var/lib/django-apps/${name}/source";
DynamicUser = true;
};
} serviceContent
)
) config.timers)
) cfg.sites);
};