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

[change] Added variable to configure daphne websocket timeout #321

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented Dec 6, 2021

This timeout value is also used for configuring the "group_expiry"
of CHANNEL_LAYERS.

This timeout value is also used for configuring the "group_expiry"
of CHANNEL_LAYERS.
@@ -2,7 +2,7 @@
user={{ www_user }}
socket=unix://{{ openwisp2_path }}/daphne0.sock
directory={{ openwisp2_path }}
command={{ openwisp2_path }}/env/bin/daphne --fd 0 -u {{ openwisp2_path }}/daphne%(process_num)d.sock --access-log - --proxy-headers openwisp2.asgi:application
command={{ openwisp2_path }}/env/bin/daphne --fd 0 -u {{ openwisp2_path }}/daphne%(process_num)d.sock --access-log - --websocket_timeout {{ openwisp2_daphne_websocket_timeout }} --proxy-headers openwisp2.asgi:application
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for websocket_timeout is 24 hours. This is the maximum allowed time a websocket is allowed to stay connected. In OpenWISP, I believe 1 hour is more than enough.

@pandafy pandafy self-assigned this Dec 6, 2021
@pandafy pandafy added this to To do (general) in OpenWISP Contributor's Board via automation Dec 6, 2021
@pandafy pandafy requested review from nemesifier and removed request for nemesifier December 6, 2021 13:09
@pandafy pandafy moved this from To do (general) to Needs review in OpenWISP Contributor's Board Dec 6, 2021
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check whether the frontend JS code can handle the timeout and reconnect.

@pandafy
Copy link
Member Author

pandafy commented Dec 6, 2021

Screenshot from 2021-12-06 21-12-17

My previous observations were wrong. The ReconnectingWebsocket library opens a new websocket connection when the existing one is ended by the server.

meta/main.yml Outdated
@@ -9,7 +9,7 @@ dependencies:
postfix_smtpd_relay_restrictions: "{{ postfix_smtpd_relay_restrictions_override }}"

- src: https://github.com/openwisp/ansible-ow-influxdb
version: origin/master
version: origin/issues/3-updating-user-password
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this will have to be updated

OpenWISP Contributor's Board automation moved this from Needs review to In progress Dec 15, 2021
@nemesifier nemesifier merged commit 109f5bd into master Dec 15, 2021
OpenWISP Contributor's Board automation moved this from In progress to Done Dec 15, 2021
@nemesifier nemesifier deleted the daphne-websocket-timeout branch December 15, 2021 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants