Skip to content
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

Make eventSource use timeout for reconnect #34

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

runeharlyk
Copy link
Collaborator

Purpose

  • When the ESP is temporarily disconnected, the frontend tries to reconnect every 2000 ms. This means when the ESP becomes online again, all those connections become active.
  • The hot reloading creates new connection as the unresponsive timeout is not cleared.

Description

By changing the EventSource reconnect to use a timeout instead of a interval and clearing the unresponsive timeout at disconnect only one connection will be active at a given moment.

@runeharlyk runeharlyk changed the title Makes eventSource use timeout for reconnect Make eventSource use timeout for reconnect Apr 3, 2024
@theelims theelims merged commit b072393 into theelims:main Apr 3, 2024
@theelims
Copy link
Owner

theelims commented Apr 3, 2024

Thank you so much for this contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants