summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorSilvan Mosberger <infinisil@icloud.com>2019-02-14 18:27:48 +0100
committerSilvan Mosberger <infinisil@icloud.com>2019-02-14 18:33:59 +0100
commitcf2f5850e21416f809100ac734e9835bd8624eaf (patch)
treea15cd218d748d7254902c29ec212724e668e13ca /nixos
parent0ac83f0857c2edfb79572361fb2673725ff762b3 (diff)
downloadnixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.tar
nixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.tar.gz
nixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.tar.bz2
nixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.tar.lz
nixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.tar.xz
nixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.tar.zst
nixpkgs-cf2f5850e21416f809100ac734e9835bd8624eaf.zip
nixos/znapzend: Run znapzendzetup import in parallel
Patch by @Baughn, who noticed these imports being very slow when run
serially with many datasets, so much that the service would time out and
fail, this fixes it.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/backup/znapzend.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix
index fc8a424190f..11b6215794e 100644
--- a/nixos/modules/services/backup/znapzend.nix
+++ b/nixos/modules/services/backup/znapzend.nix
@@ -382,8 +382,10 @@ in
             | xargs -I{} ${pkgs.znapzend}/bin/znapzendzetup delete "{}"
         '' + concatStringsSep "\n" (mapAttrsToList (dataset: config: ''
           echo Importing znapzend zetup ${config} for dataset ${dataset}
-          ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config}
-        '') files);
+          ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config} &
+        '') files) + ''
+          wait
+        '';
 
         serviceConfig = {
           ExecStart = let