-
Notifications
You must be signed in to change notification settings - Fork 46
Reconnect when no data is received for 5 minutes. #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
name = m.groupdict()['name'] | ||
value = m.groupdict()['value'] | ||
if name == '': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wasn't actually working.
self.resp = requester.get( | ||
self.url, | ||
stream=True, | ||
timeout=(self._connect_timeout, self._read_timeout), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the read_timeout here means that the request will throw a timeout error if no data is received for 5 minutes.. thus implementing heartbeat detection.
ldclient/streaming.py
Outdated
store.delete(key, version) | ||
else: | ||
log.warning('Unhandled event in stream processor: ' + msg.event) | ||
elif msg.event != 'comment': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this back
ldclient/sse_client.py
Outdated
and return a Event object. | ||
""" | ||
msg = cls() | ||
if raw.startswith(':'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this-- not necessary.
👍 |
better log output for stream failures
Reconnect when no data is received for 5 minutes.