Messages should always be posted to the Redis bus in valid JSON format - no need for ast.literal_eval fallback
This commit is contained in:
parent
347a4d2555
commit
adb472da7f
1 changed files with 1 additions and 9 deletions
|
@ -1,5 +1,3 @@
|
||||||
import ast
|
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
@ -39,13 +37,7 @@ class RedisBus(Bus):
|
||||||
if not msg or msg[1] is None:
|
if not msg or msg[1] is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
msg = msg[1].decode('utf-8')
|
msg = Message.build(msg[1].decode('utf-8'))
|
||||||
try:
|
|
||||||
msg = json.loads(msg)
|
|
||||||
except json.decoder.JSONDecodeError:
|
|
||||||
msg = ast.literal_eval(msg)
|
|
||||||
|
|
||||||
msg = Message.build(msg)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue