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.
commitcf2f5850e21416f809100ac734e9835bd8624eaf
authorSilvan Mosberger <infinisil@icloud.com>
dateThu 14 Feb 2019, 18:27 (8 years ago)
parent0ac83f0
nixos/modules/services/backup/znapzend.nix+4−2
@@ -382,8 +382,10 @@ in
382382 | xargs -I{} ${pkgs.znapzend}/bin/znapzendzetup delete "{}"
383383 '' + concatStringsSep "\n" (mapAttrsToList (dataset: config: ''
384384 echo Importing znapzend zetup ${config} for dataset ${dataset}
385− ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config}
386− '') files);
385+ ${pkgs.znapzend}/bin/znapzendzetup import --write ${dataset} ${config} &
386+ '') files) + ''
387+ wait
388+ '';
387389
388390 serviceConfig = {
389391 ExecStart = let