From 8c2ffbe76a82972de35493826b3d29591e2240cf Mon Sep 17 00:00:00 2001 From: Matt Grutza Date: Wed, 21 Jan 2026 17:59:23 -0600 Subject: [PATCH] CELERY_NICE_LEVEL warning Changed the celery entrypoint to include a warning if CELERY_NICE_LEVEL is negative AND SYS_NICE is not configured (SYS_NICE is required for negative levels) --- docker/entrypoint.celery.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.celery.sh b/docker/entrypoint.celery.sh index 0516cc54..81cece86 100644 --- a/docker/entrypoint.celery.sh +++ b/docker/entrypoint.celery.sh @@ -19,4 +19,11 @@ done # Start Celery echo 'Migrations complete, starting Celery...' celery -A dispatcharr beat -l info & -nice -n ${CELERY_NICE_LEVEL:-5} celery -A dispatcharr worker -l info --autoscale=6,1 + +# Default to nice level 5 (lower priority) - safe for unprivileged containers +# Negative values require SYS_NICE capability +NICE_LEVEL="${CELERY_NICE_LEVEL:-5}" +if [ "$NICE_LEVEL" -lt 0 ] 2>/dev/null; then + echo "Warning: CELERY_NICE_LEVEL=$NICE_LEVEL is negative, requires SYS_NICE capability" +fi +nice -n "$NICE_LEVEL" celery -A dispatcharr worker -l info --autoscale=6,1