get_bus() should return a default RedisBus() instance if the main bus is not registered

This commit is contained in:
Fabio Manganiello 2022-04-02 22:47:23 +02:00
parent b1491b8048
commit f7c594cc3f
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -133,9 +133,12 @@ def get_plugin(plugin_name, reload=False):
def get_bus() -> Bus: def get_bus() -> Bus:
global main_bus global main_bus
assert main_bus, 'The bus is not registered' if main_bus:
return main_bus return main_bus
from platypush.bus.redis import RedisBus
return RedisBus()
def get_or_create_event_loop(): def get_or_create_event_loop():
try: try: