From cf2f5850e21416f809100ac734e9835bd8624eaf Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 14 Feb 2019 18:27:48 +0100 Subject: [PATCH] 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. --- nixos/modules/services/backup/znapzend.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix index fc8a424190f7..11b6215794ec 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