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

Handle TimeoutError in FC2WebSocket._main_loop #48

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

15532th
Copy link
Contributor

@15532th 15532th commented Sep 16, 2023

Fixing #31.

Hopefully I understood original intent correctly: _try_heartbeat gets called after every received message or if there was no messages for heartbeat_interval.
Downside of the way it is done is the use of two _try_heartbeat calls, but it seems to be the easiest way to avoid sending heartbeat in response to error/end of stream message, when _main_loop raises exception.

Is debug a fitting log level for message about timeout? I used it because heartbeat message itself is debug, but perhaps it should have been trace?

@hizkifw
Copy link
Member

hizkifw commented Sep 18, 2023

Looks good! The double call should be fine as there's a debounce logic in the _try_heartbeat method. I think using debug is good, I'm reserving trace for things that are too verbose for debug such as the raw websocket messages.

@hizkifw hizkifw merged commit ad4ee15 into HoloArchivists:main Sep 18, 2023
6 checks passed
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