From 8a90dffb65876a01f3c9423cbbf7733f0ca2b869 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Tue, 26 Feb 2019 14:14:56 +0100 Subject: [PATCH] fix: [dispatcher] EventTags were not processed correctly --- zmq_dispatcher.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/zmq_dispatcher.py b/zmq_dispatcher.py index f7e73bb..37a3874 100755 --- a/zmq_dispatcher.py +++ b/zmq_dispatcher.py @@ -167,11 +167,8 @@ def handler_event(zmq_name, jsonobj): timestamp = jsonevent['timestamp'] trendings_helper.addTrendingEvent(eventName, timestamp) tags = [] - for tag in jsonobj.get('EventTag', []): - try: - tags.append(tag['Tag']) - except KeyError: - pass + for tag in jsonevent.get('Tag', []): + tags.append(tag) trendings_helper.addTrendingTags(tags, timestamp) #redirect to handler_attribute @@ -208,10 +205,7 @@ def handler_attribute(zmq_name, jsonobj, hasAlreadyBeenContributed=False): trendings_helper.addTrendingCateg(categName, timestamp) tags = [] for tag in jsonattr.get('Tag', []): - try: - tags.append(tag) - except KeyError: - pass + tags.append(tag) trendings_helper.addTrendingTags(tags, timestamp) to_push = []