Try to decode the message event if it's not a Platypush message

This commit is contained in:
Fabio Manganiello 2018-06-29 11:09:28 +02:00
parent 3872276234
commit 57baa0c64a

View file

@ -48,8 +48,14 @@ class RedisBackend(Backend):
try:
msg = Message.build(json.loads(msg))
except:
import ast
msg = Message.build(ast.literal_eval(msg))
try:
import ast
msg = Message.build(ast.literal_eval(msg))
except:
try:
msg = json.loads(msg)
except Exception as e:
self.logger.exception(e)
return msg