diff --git a/api/scripts/run-docker.sh b/api/scripts/run-docker.sh index b3779157cfd7..79133d4254a1 100755 --- a/api/scripts/run-docker.sh +++ b/api/scripts/run-docker.sh @@ -33,7 +33,11 @@ function run_task_processor() { if [[ -n "$ANALYTICS_DATABASE_URL" || -n "$DJANGO_DB_NAME_ANALYTICS" ]]; then python manage.py waitfordb --waitfor 30 --migrations --database analytics fi - RUN_BY_PROCESSOR=1 python manage.py runprocessor --sleepintervalms 500 + RUN_BY_PROCESSOR=1 python manage.py runprocessor \ + --sleepintervalms ${TASK_PROCESSOR_SLEEP_INTERVAL:-500} \ + --graceperiodms ${TASK_PROCESSOR_GRACE_PERIOD_MS:-20000} \ + --numthreads ${TASK_PROCESSOR_NUM_THREADS:-5} \ + --queuepopsize ${TASK_PROCESSOR_QUEUE_POP_SIZE:-10} } function migrate_identities(){ python manage.py migrate_to_edge "$1" diff --git a/api/task_processor/management/commands/runprocessor.py b/api/task_processor/management/commands/runprocessor.py index df282de334f2..6f46d788a742 100644 --- a/api/task_processor/management/commands/runprocessor.py +++ b/api/task_processor/management/commands/runprocessor.py @@ -60,6 +60,11 @@ def handle(self, *args, **options): grace_period_ms = options["graceperiodms"] queue_pop_size = options["queuepopsize"] + logger.debug( + "Running task processor with args: %s", + ",".join([f"{k}={v}" for k, v in options.items()]), + ) + self._threads.extend( [ TaskRunner(