Enforced cast to string for any object posted to the Redis bus
This commit is contained in:
parent
c2be1cf6e8
commit
6603f64757
3 changed files with 5 additions and 3 deletions
|
@ -149,7 +149,7 @@ class HttpBackend(Backend):
|
|||
|
||||
redis = self._get_redis()
|
||||
if redis:
|
||||
redis.rpush(self.redis_queue, stop_evt)
|
||||
redis.rpush(self.redis_queue, str(stop_evt))
|
||||
|
||||
if self.server_proc:
|
||||
self.server_proc.terminate()
|
||||
|
@ -284,7 +284,7 @@ class HttpBackend(Backend):
|
|||
|
||||
redis = self._get_redis()
|
||||
if redis:
|
||||
redis.rpush(self.redis_queue, event)
|
||||
redis.rpush(self.redis_queue, str(event))
|
||||
return jsonify({ 'status': 'ok' })
|
||||
|
||||
@app.route('/static/<path>', methods=['GET'])
|
||||
|
|
|
@ -35,6 +35,7 @@ class RedisBackend(Backend):
|
|||
|
||||
|
||||
def send_message(self, msg, queue_name=None):
|
||||
msg = str(msg)
|
||||
if queue_name:
|
||||
self.redis.rpush(queue_name, msg)
|
||||
else:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import ast
|
||||
import statistics
|
||||
import json
|
||||
import time
|
||||
|
||||
from threading import Thread, Lock
|
||||
|
@ -141,7 +142,7 @@ class AdafruitIoPlugin(Plugin):
|
|||
else:
|
||||
# Otherwise send it to the Redis queue to be picked up by the throttler thread
|
||||
redis = self._get_redis()
|
||||
redis.rpush(self._DATA_THROTTLER_QUEUE, {feed:value})
|
||||
redis.rpush(self._DATA_THROTTLER_QUEUE, json.dumps({feed:value}))
|
||||
|
||||
|
||||
@action
|
||||
|
|
Loading…
Reference in a new issue