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

@@ -19,7 +19,8 @@ for command in decrypt_documents \
manage_superuser \
convert_mariadb_uuid \
prune_audit_logs \
createsuperuser;
createsuperuser \
document_perf_benchmark;
do
echo "installing $command..."
sed "s/management_command/$command/g" management_script.sh >"$PWD/rootfs/usr/local/bin/$command"

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