Skip to content

Commit 3e6aa63

Browse files
committed
paperless-ngx: fix tests on machines with 256 cores
1 parent ce8e5b4 commit 3e6aa63

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkgs/by-name/pa/paperless-ngx/package.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ python.pkgs.buildPythonApplication rec {
315315
export HOME=$(mktemp -d)
316316
export XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS"
317317
export PAPERLESS_NLTK_DIR=${passthru.nltkDataDir}
318+
# Limit threads per worker based on NIX_BUILD_CORES, capped at 256
319+
# ocrmypdf has an internal limit of 256 jobs and will fail with more
320+
export PAPERLESS_THREADS_PER_WORKER=$(( NIX_BUILD_CORES > 256 ? 256 : NIX_BUILD_CORES ))
318321
'';
319322

320323
disabledTests = [

0 commit comments

Comments
 (0)