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.
This commit is contained in:
Silvan Mosberger
2019-02-14 18:27:48 +01:00
parent 0ac83f0857
commit cf2f5850e2

View File

@@ -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