From 13463420d90f4d40ddd3df396b09f83cdfa55860 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 18 Dec 2018 12:21:55 +0100 Subject: [PATCH] Made Redis bus/local bus choice more flexible --- platypush/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platypush/__init__.py b/platypush/__init__.py index 6c40b71ed..ad7d303ce 100644 --- a/platypush/__init__.py +++ b/platypush/__init__.py @@ -12,6 +12,7 @@ import traceback from threading import Thread +from .bus import Bus from .bus.redis import RedisBus from .config import Config from .context import register_backends @@ -120,7 +121,12 @@ class Daemon: def start(self): """ Start the daemon """ - self.bus = RedisBus(on_message=self.on_message()) + redis_conf = Config.get('backend.redis') + if redis_conf: + self.bus = RedisBus(on_message=self.on_message(), + **redis_conf.get('redis_args', {})) + else: + self.bus = Bus(on_message=self.on_message()) # Initialize the backends and link them to the bus self.backends = register_backends(bus=self.bus, global_scope=True)