Prevent a tight loop in HttpPoll if one of the requests fails
This commit is contained in:
parent
3174db5776
commit
b32232b46e
1 changed files with 5 additions and 1 deletions
|
@ -73,7 +73,11 @@ class HttpPollBackend(Backend):
|
|||
while not self.should_stop():
|
||||
for request in self.requests:
|
||||
if time.time() - request.last_request_timestamp > request.poll_seconds:
|
||||
try:
|
||||
request.execute()
|
||||
except Exception as e:
|
||||
self.logger.error('Error while executing request: {}'.format(request))
|
||||
self.logger.exception(e)
|
||||
|
||||
time.sleep(0.1) # Prevent a tight loop
|
||||
|
||||
|
|
Loading…
Reference in a new issue