lib: Make awaitPostgres code early in preStart
This commit is contained in:
parent
64c3e2d720
commit
c55600c5af
@ -4,7 +4,8 @@ let
|
||||
inherit (lib)
|
||||
genAttrs mapAttrsToList filterAttrsRecursive nameValuePair types
|
||||
mkOption mkOverride mkForce mkIf mergeEqualOption optional
|
||||
showWarnings concatStringsSep flatten unique optionalAttrs;
|
||||
showWarnings concatStringsSep flatten unique optionalAttrs
|
||||
mkBefore;
|
||||
inherit (lib.flake) defaultSystems;
|
||||
in
|
||||
rec {
|
||||
@ -166,7 +167,7 @@ rec {
|
||||
|
||||
systemdAwaitPostgres = pkg: host: {
|
||||
after = [ "systemd-networkd-wait-online.service" ];
|
||||
preStart = ''
|
||||
preStart = mkBefore ''
|
||||
until ${pkg}/bin/pg_isready -h ${host}; do
|
||||
sleep 0.5
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user