Skip to content

Commit

Permalink
Add Task Processor inputs as env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Jan 31, 2024
1 parent 31af594 commit 074d30d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/scripts/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions api/task_processor/management/commands/runprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 074d30d

Please sign in to comment.