Skip to content
Snippets Groups Projects
Commit 52867d74 authored by Prathamesh Joshi's avatar Prathamesh Joshi
Browse files

add logging for long timeouts

parent b7f7bbb2
No related branches found
No related tags found
1 merge request!639O4c Bug Fixes and Logging AllSky
Pipeline #702370 passed
......@@ -138,7 +138,6 @@ class EventProcessor(object):
"""Fetch for messages from a topic and processes them.
"""
logging.debug("polling for new events")
messages = self.consumer.consume(
num_messages=self.num_messages,
timeout=self.request_timeout
......@@ -165,6 +164,8 @@ class EventProcessor(object):
if self.send_heartbeats:
self.heartbeat()
elapsed = timeit.default_timer() - start
if elapsed > 20:
logging.warning(f'{str(round(elapsed, 2))}s have passed since the last process() loop, which is greater than the threshold of 20s')
time.sleep(max(self.process_cadence - elapsed, 0))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment