From a375baa1ebd825aa325f432699ee4b33c9fb7406 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Jul 09 2021 19:52:31 +0000 Subject: decode protonmsg props field when loading from db --- diff --git a/plugins/hub/protonmsg.py b/plugins/hub/protonmsg.py index 3fc62b0..9cbdf08 100644 --- a/plugins/hub/protonmsg.py +++ b/plugins/hub/protonmsg.py @@ -348,6 +348,11 @@ def handle_db_msgs(urls, CONFIG): columns=('id', 'address', 'props', 'body'), opts={'order': 'id', 'limit': limit}) msgs = list(query.execute()) + for msg in msgs: + try: + msg['props'] = json.loads(msg['props']) + except Exception: + LOG.error('Unable to load message from db: %r', msg) if not msgs: return if CONFIG.getboolean('broker', 'test_mode', fallback=False):