From faaf07cf865c8c26a56e6fc85cbfcde3e4a7127e Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Sat, 12 Sep 2026 14:20:49 +0200 Subject: [PATCH] Add --no-sync to Paperless uv run services Updates Paperless NGX service handling so `uv run` commands consistently include `--no-sync`. The update script now patches all Paperless systemd units (`consumer`, `scheduler`, `task-queue`, and `webserver`) and adjusts the webserver `ExecStartPre` reindex command accordingly, then reloads systemd once after these edits. The install template comment was updated to match the new `ExecStartPre` form. --- ct/paperless-ngx.sh | 8 ++++++-- install/paperless-ngx-install.sh | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ct/paperless-ngx.sh b/ct/paperless-ngx.sh index dffe537d9..1be02bfd5 100644 --- a/ct/paperless-ngx.sh +++ b/ct/paperless-ngx.sh @@ -169,9 +169,13 @@ function update_script() { if ((BRIDGE_UPDATE == 0)); then sed -i 's|^ExecStart=.*|ExecStart=uv run --no-sync -- granian --interface asginl --ws --loop uvloop "paperless.asgi:application"|' /etc/systemd/system/paperless-webserver.service grep -q "document_index reindex" /etc/systemd/system/paperless-webserver.service || - sed -i '/^ExecStart=/i ExecStartPre=uv run -- python manage.py document_index reindex --if-needed --no-progress-bar' /etc/systemd/system/paperless-webserver.service - $STD systemctl daemon-reload + sed -i '/^ExecStart=/i ExecStartPre=uv run --no-sync -- python manage.py document_index reindex --if-needed --no-progress-bar' /etc/systemd/system/paperless-webserver.service fi + for svc in consumer scheduler task-queue webserver; do + unit="/etc/systemd/system/paperless-${svc}.service" + [[ -f "$unit" ]] && sed -i 's|uv run -- |uv run --no-sync -- |g' "$unit" + done + $STD systemctl daemon-reload cd /opt/paperless $STD uv sync --all-extras cd /opt/paperless/src diff --git a/install/paperless-ngx-install.sh b/install/paperless-ngx-install.sh index f88b6755c..8348e5ebe 100644 --- a/install/paperless-ngx-install.sh +++ b/install/paperless-ngx-install.sh @@ -151,7 +151,7 @@ Requires=redis.service [Service] WorkingDirectory=/opt/paperless/src -#ExecStartPre=uv run -- python manage.py document_index reindex --if-needed --no-progress-bar +#ExecStartPre=uv run --no-sync -- python manage.py document_index reindex --if-needed --no-progress-bar ExecStart=uv run --no-sync -- granian --interface asginl --ws --loop uvloop "paperless.asgi:application" Environment=GRANIAN_HOST=:: Environment=GRANIAN_PORT=8000