decode protonmsg props field when loading from db

This commit is contained in:
Mike McLean 2021-07-09 15:35:32 -04:00 committed by Tomas Kopecek
parent fdccd38148
commit b4b83c8251

View file

@ -350,6 +350,11 @@ def handle_db_msgs(urls, CONFIG):
aliases=('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):