Performance script, available as management command

[ci skip]
This commit is contained in:
shamoon
2026-01-28 09:54:07 -08:00
parent d9091aa42b
commit 8c01926be5
3 changed files with 682 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
#!/command/with-contenv /usr/bin/bash
# shellcheck shell=bash
set -e
cd "${PAPERLESS_SRC_DIR}"
if [[ -n "${USER_IS_NON_ROOT}" ]]; then
python3 manage.py document_perf_benchmark "$@"
elif [[ $(id -u) == 0 ]]; then
s6-setuidgid paperless python3 manage.py document_perf_benchmark "$@"
elif [[ $(id -un) == "paperless" ]]; then
python3 manage.py document_perf_benchmark "$@"
else
echo "Unknown user."
exit 1
fi