diff --git a/README.md b/README.md index ea207acd..6d65fcc3 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ CACHES = { # Maximum seconds between two reconnection attempts that would cause the client give up. # 0 will disable reconnection. -IDOM_WS_MAX_RECONNECT_DELAY: int = 604800 +IDOM_WS_MAX_RECONNECT_TIMEOUT: int = 604800 # The URL for IDOM to serve its Websockets IDOM_WEBSOCKET_URL: str = "idom/" diff --git a/src/django_idom/config.py b/src/django_idom/config.py index 37d78ad0..c024d77d 100644 --- a/src/django_idom/config.py +++ b/src/django_idom/config.py @@ -8,7 +8,9 @@ IDOM_REGISTERED_COMPONENTS: Dict[str, ComponentConstructor] = {} IDOM_WEBSOCKET_URL = getattr(settings, "IDOM_WEBSOCKET_URL", "idom/") -IDOM_WS_MAX_RECONNECT_DELAY = getattr(settings, "IDOM_WS_MAX_RECONNECT_DELAY", 604800) +IDOM_WS_MAX_RECONNECT_TIMEOUT = getattr( + settings, "IDOM_WS_MAX_RECONNECT_TIMEOUT", 604800 +) # Determine if using Django caching or LRU cache if "idom" in getattr(settings, "CACHES", {}): diff --git a/src/django_idom/templates/idom/component.html b/src/django_idom/templates/idom/component.html index 8509bceb..fc8ba6f8 100644 --- a/src/django_idom/templates/idom/component.html +++ b/src/django_idom/templates/idom/component.html @@ -7,7 +7,7 @@ mountPoint, "{{ idom_websocket_url }}", "{{ idom_web_modules_url }}", - "{{ idom_ws_max_reconnect_delay }}", + "{{ idom_ws_max_reconnect_timeout }}", "{{ idom_component_id }}", "{{ idom_component_params }}" ); diff --git a/src/django_idom/templatetags/idom.py b/src/django_idom/templatetags/idom.py index d21620bc..28def13e 100644 --- a/src/django_idom/templatetags/idom.py +++ b/src/django_idom/templatetags/idom.py @@ -5,7 +5,7 @@ from django import template from django.urls import reverse -from django_idom.config import IDOM_WEBSOCKET_URL, IDOM_WS_MAX_RECONNECT_DELAY +from django_idom.config import IDOM_WEBSOCKET_URL, IDOM_WS_MAX_RECONNECT_TIMEOUT from django_idom.utils import _register_component @@ -24,7 +24,7 @@ def idom_component(_component_id_, **kwargs): "class": class_, "idom_websocket_url": IDOM_WEBSOCKET_URL, "idom_web_modules_url": IDOM_WEB_MODULES_URL, - "idom_ws_max_reconnect_delay": IDOM_WS_MAX_RECONNECT_DELAY, + "idom_ws_max_reconnect_timeout": IDOM_WS_MAX_RECONNECT_TIMEOUT, "idom_mount_uuid": uuid4().hex, "idom_component_id": _component_id_, "idom_component_params": urlencode({"kwargs": json_kwargs}),