Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/mergin/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from .config import Configuration
from .app import mail


# create on flask app independent object
# we need this for defining tasks, and celery is then configured in run_celery.py
celery = Celery(
Expand Down Expand Up @@ -68,6 +67,7 @@ def __call__(self, *args, **kwargs):
celery.conf.update(app.config)
celery.conf.update(
task_acks_late=Configuration.CELERY_ACKS_LATE,
task_send_sent_event=Configuration.CELERY_SEND_TASK_SENT_EVENT,
worker_concurrency=Configuration.CELERYD_CONCURRENCY,
worker_prefetch_multiplier=Configuration.CELERYD_PREFETCH_MULTIPLIER,
)
Expand Down
5 changes: 5 additions & 0 deletions server/mergin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ class Configuration(object):
"CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS", default="{}", cast=eval
)
CELERY_ACKS_LATE = config("CELERY_ACKS_LATE", default=False, cast=bool)
# send a task-sent event when a task is published so that monitoring tools
# (e.g. celery-exporter) can report the queue name, including for failed tasks
CELERY_SEND_TASK_SENT_EVENT = config(
"CELERY_SEND_TASK_SENT_EVENT", default=False, cast=bool
)
CELERYD_CONCURRENCY = config("CELERYD_CONCURRENCY", default=1, cast=int)
CELERYD_PREFETCH_MULTIPLIER = config(
"CELERYD_PREFETCH_MULTIPLIER", default=4, cast=int
Expand Down
Loading