Skip to content

Commit

Permalink
#38: Make Celery configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Jun 17, 2020
1 parent 1c08931 commit 6af1870
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ ARG FRONTEND_VERSION=UNKNOWN
# runtime arguments
ENV DEBIAN_FRONTEND=noninteractive \
# Set to "c" for English, pl-PL.UTF-8 for Polish etc.
LANG=c \
LANG=en_US.UTF-8 \
# Timezone
TZ="Europe/Warsaw" \
# Set to "c" for English, pl-PL.UTF-8 for Polish etc.
LC_TYPE=en_US.UTF-8 \
# Enable mail server
Expand Down
39 changes: 39 additions & 0 deletions container-files/opt/taiga-conf/taiga/celery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <[email protected]>
# Copyright (C) 2014-2017 Jesús Espino <[email protected]>
# Copyright (C) 2014-2017 David Barragán <[email protected]>
# Copyright (C) 2014-2017 Alejandro Alonso <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from kombu import Queue

broker_url = os.getenv('TAIGA_BROKER_URL', 'amqp://guest:guest@rabbit:5672')
result_backend = os.getenv('TAIGA_REDIS_URL', 'redis://redis:6379/0').replace('"', '')

configured_serializer_type = os.getenv('CELERY_SERIALIZER_TYPE', 'pickle').replace('"', '')

accept_content = [configured_serializer_type,] # Values are 'pickle', 'json', 'msgpack' and 'yaml'
task_serializer = configured_serializer_type
result_serializer = configured_serializer_type

timezone = os.getenv('TZ', 'Europe/Warsaw').replace('"', '')

task_default_queue = 'tasks'
task_queues = (
Queue('tasks', routing_key='task.#'),
Queue('transient', routing_key='transient.#', delivery_mode=1)
)
task_default_exchange = 'tasks'
task_default_exchange_type = 'topic'
task_default_routing_key = 'task.default'

0 comments on commit 6af1870

Please sign in to comment.