Skip to content

Commit

Permalink
introduce malware queue (#7227)
Browse files Browse the repository at this point in the history
* introduce malware queue

* correct syntax, apparently list of tuples documented doesn't work.
  • Loading branch information
ewdurbin committed Feb 18, 2020
1 parent 328b0ee commit a9572b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ release: bin/release
web: bin/start-web python -m gunicorn.app.wsgiapp -c gunicorn.conf.py warehouse.wsgi:application
web-uploads: bin/start-web python -m gunicorn.app.wsgiapp -c gunicorn-uploads.conf.py warehouse.wsgi:application
worker: bin/start-worker celery -A warehouse worker -Q default -l info --max-tasks-per-child 32
worker-malware: bin/start-worker celery -A warehouse worker -Q malware -l info --max-tasks-per-child 32
worker-beat: bin/start-worker celery -A warehouse beat -S redbeat.RedBeatScheduler -l info
7 changes: 5 additions & 2 deletions tests/unit/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,11 @@ def test_includeme(env, ssl, broker_url, expected_url, transport_options):
"task_serializer": "json",
"accept_content": ["json", "msgpack"],
"task_queue_ha_policy": "all",
"task_queues": (Queue("default", routing_key="task.#"),),
"task_routes": ([]),
"task_queues": (
Queue("default", routing_key="task.#"),
Queue("malware", routing_key="malware.#"),
),
"task_routes": {"warehouse.malware.tasks.*": {"queue": "malware"}},
"REDBEAT_REDIS_URL": (config.registry.settings["celery.scheduler_url"]),
}.items():
assert app.conf[key] == value
Expand Down
7 changes: 5 additions & 2 deletions warehouse/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ def includeme(config):
task_default_queue="default",
task_default_routing_key="task.default",
task_queue_ha_policy="all",
task_queues=(Queue("default", routing_key="task.#"),),
task_routes=([]),
task_queues=(
Queue("default", routing_key="task.#"),
Queue("malware", routing_key="malware.#"),
),
task_routes={"warehouse.malware.tasks.*": {"queue": "malware"}},
task_serializer="json",
worker_disable_rate_limits=True,
REDBEAT_REDIS_URL=s["celery.scheduler_url"],
Expand Down

0 comments on commit a9572b9

Please sign in to comment.