Skip to content

Commit

Permalink
[Celery]Using multiple queues
Browse files Browse the repository at this point in the history
Using multiple queues the tasks from different types can be served in parallel.
  • Loading branch information
cronosnull committed Jun 4, 2020
1 parent 74e63fa commit 42fe429
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
- CMS_ES_CONF_FILE=/run/secrets/es-conf
- REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
- LOGLEVEL=DEBUG
entrypoint: ['celery', "-A", "htcondor_es.celery.celery", "worker"]
entrypoint: ['celery', "-A", "htcondor_es.celery.celery", "worker","-Q","default,es_post,convert"]
secrets: &secrets
- amq-username
- amq-password
Expand Down
4 changes: 2 additions & 2 deletions src/htcondor_es/celery/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def query_schedd(
return (schedd_ad["name"], n_tasks)


@app.task(ignore_result=True)
@app.task(ignore_result=True,queue="convert")
def process_docs(
docs,
reduce_data=True,
Expand Down Expand Up @@ -169,7 +169,7 @@ def process_docs(
return post_ads(converted_docs) if converted_docs else []


@app.task(ignore_result=True)
@app.task(ignore_result=True, queue="es_post")
def post_ads_es(es_docs, es_index, metadata=None):
"""
Send the messages to ES.
Expand Down

0 comments on commit 42fe429

Please sign in to comment.