from datetime import timedelta from kombu import Queue, Exchange from celery import Celery import logging from conf import setup_app from conf.celery import * LOG = logging.getLogger(__name__) config = setup_app('monitor') BROKER_URL = config.broker if "rabbitmq" in config.broker: default_exchange = Exchange('default', type='fanout') monitor_exchange = Exchange('monitor', type='fanout') reactor_exchange = Exchange('reactor', type='fanout') planner_exchange = Exchange('planner', type='fanout') CELERY_RESULT_BACKEND = "amqp" CELERY_QUEUES = ( Queue('default', default_exchange, routing_key='default'), Queue('monitor', monitor_exchange, routing_key='monitor_%s' % config.hostname), Queue('planner', planner_exchange, routing_key='planner.#'), ) elif "redis" in config.broker: CARROT_BACKEND = "redis"
from datetime import timedelta from kombu import Queue, Exchange from celery import Celery import logging from conf import setup_app from conf.celery import * LOG = logging.getLogger(__name__) config = setup_app('monitor') BROKER_URL = config.broker if "amqp" in config.broker: default_exchange = Exchange('default') monitor_exchange = Exchange('monitor', type='fanout') reactor_exchange = Exchange('reactor', type='fanout') planner_exchange = Exchange('planner', type='fanout') CELERY_RESULT_BACKEND = "amqp" CELERY_QUEUES = ( Queue('default', default_exchange, routing_key='default'), Queue('monitor', monitor_exchange, routing_key='monitor_%s' % config.hostname), Queue('planner', planner_exchange, routing_key='planner.#'), ) elif "redis" in config.broker: CARROT_BACKEND = "redis"
import logging from datetime import timedelta from kombu import Queue, Exchange from celery import Celery from conf import setup_app from conf.celery import * LOG = logging.getLogger(__name__) config = setup_app("planner") BROKER_URL = config.broker if "amqp" in config.broker: default_exchange = Exchange("default") monitor_exchange = Exchange("monitor", type="fanout") reactor_exchange = Exchange("reactor", type="fanout") planner_exchange = Exchange("planner", type="fanout") CELERY_RESULT_BACKEND = "amqp" CELERY_QUEUES = ( Queue("default", default_exchange, routing_key="default"), Queue("monitor", monitor_exchange, routing_key="monitor.#"), Queue("planner", planner_exchange, routing_key="planner.#"), ) elif "redis" in config.broker: CARROT_BACKEND = "redis"
import logging from datetime import timedelta from kombu import Queue, Exchange from celery import Celery from conf import setup_app from conf.celery import * LOG = logging.getLogger(__name__) config = setup_app('planner') BROKER_URL = config.broker if "rabbitmq" in config.broker: default_exchange = Exchange('default', type='fanout') monitor_exchange = Exchange('monitor', type='fanout') reactor_exchange = Exchange('reactor', type='fanout') planner_exchange = Exchange('planner', type='fanout') CELERY_RESULT_BACKEND = "amqp" CELERY_QUEUES = ( Queue('default', default_exchange, routing_key='default'), Queue('monitor', monitor_exchange, routing_key='monitor.#'), Queue('planner', planner_exchange, routing_key='planner.#'), ) elif "redis" in config.broker:
import logging from kombu import Queue, Exchange from celery import Celery from conf import setup_app from conf.celery import * LOG = logging.getLogger(__name__) config = setup_app('reactor') BROKER_URL = config.broker if "rabbitmq" in config.broker: default_exchange = Exchange('default', type='fanout') monitor_exchange = Exchange('monitor', type='fanout') reactor_exchange = Exchange('reactor', type='fanout') planner_exchange = Exchange('planner', type='fanout') CELERY_RESULT_BACKEND = "amqp" CELERY_QUEUES = ( Queue('default', default_exchange, routing_key='default'), Queue('monitor', monitor_exchange, routing_key='monitor.#'), Queue('planner', planner_exchange, routing_key='planner.#'), ) elif "redis" in config.broker: CARROT_BACKEND = "redis" CELERY_RESULT_BACKEND = BROKER_URL
import logging from datetime import timedelta from kombu import Queue, Exchange from celery import Celery from conf import setup_app from conf.celery import * LOG = logging.getLogger(__name__) config = setup_app('planner') BROKER_URL = config.broker if "amqp" in config.broker: default_exchange = Exchange('default') monitor_exchange = Exchange('monitor', type='fanout') reactor_exchange = Exchange('reactor', type='fanout') planner_exchange = Exchange('planner', type='fanout') CELERY_RESULT_BACKEND = "amqp" CELERY_QUEUES = ( Queue('default', default_exchange, routing_key='default'), Queue('monitor', monitor_exchange, routing_key='monitor.#'), Queue('planner', planner_exchange, routing_key='planner.#'), ) elif "redis" in config.broker: