aboutsummaryrefslogtreecommitdiffstats
path: root/miss_htbt_service/htbtworker.py
diff options
context:
space:
mode:
Diffstat (limited to 'miss_htbt_service/htbtworker.py')
-rw-r--r--miss_htbt_service/htbtworker.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/miss_htbt_service/htbtworker.py b/miss_htbt_service/htbtworker.py
index ac7a0d9..0d43533 100644
--- a/miss_htbt_service/htbtworker.py
+++ b/miss_htbt_service/htbtworker.py
@@ -98,9 +98,14 @@ def process_msg(jsfile, user_name, password, ip_address, port_num, db_name):
i = 0
break
else:
- res = requests.get(get_url)
- msg = "HBT:", res.text
- _logger.info(msg)
+ try:
+ res = requests.get(get_url)
+ except Exception as e:
+ # message-router may be down temporarily. continue polling loop to try again
+ _logger.error('HBT: Failed to fetch messages from DMaaP. get_url=%s', get_url, exc_info=e)
+ time.sleep(1)
+ continue
+ _logger.info("HBT: %s", res.text)
input_string = res.text
# If mrstatus in message body indicates some information, not json msg.
if "mrstatus" in input_string: