WIP Add callback reception in traffic handler, change redis callback to same dict as http

This commit is contained in:
nolash
2021-02-20 11:29:11 +01:00
parent e7958aaf9e
commit f2a0ef99ec
2 changed files with 24 additions and 5 deletions

View File

@@ -18,7 +18,11 @@ logg = celery_app.log.get_default_logger()
def redis(self, result, destination, status_code):
(host, port, db, channel) = destination.split(':')
r = redis_interface.Redis(host=host, port=port, db=db)
s = json.dumps(result)
data = {
'root_id': self.request.root_id,
'status': status_code,
'result': result,
}
logg.debug('redis callback on host {} port {} db {} channel {}'.format(host, port, db, channel))
r.publish(channel, s)
r.publish(channel, json.dumps(data))
r.close()