def config_from_object(self, obj, silent=False): if isinstance(obj, string_t): try: obj = self._smart_import(obj, imp=self.import_from_cwd) except (ImportError, AttributeError): if silent: return False raise self._conf = force_mapping(obj) return True
'queue': 'monitor' }, 'cumulus.tasks.job.monitor_jobs': { 'queue': 'monitor' }, 'cumulus.tasks.job.monitor_process': { 'queue': 'monitor' }, 'cumulus.task.status.monitor_status': { 'queue': 'monitor' } } command = Celery('command', backend='amqp', include=_includes) command.config_from_object(commonconfig) command.conf.update(force_mapping(commandconfig)) command.conf.update(CELERY_ROUTES=_routes, CELERY_TASK_SERIALIZER='oid_safe_json', CELERY_ACCEPT_CONTENT=('json', 'oid_safe_json', 'jsonpickle'), CELERY_RESULT_SERIALIZER='json', CELERYD_PREFETCH_MULTIPLIER=1) monitor = Celery('monitor', backend='amqp', include=_includes) monitor.config_from_object(commonconfig) monitor.conf.update(force_mapping(monitorconfig)) monitor.conf.update(CELERY_ROUTES=_routes, CELERY_ACCEPT_CONTENT=('json', 'jsonpickle'))