Skip to content

Commit 5f5eaa2

Browse files
authored
Merge pull request #3090 from opentensor/chore/thewhaleking/update-type-hints-ws-shutdown-timer
Update type hint/docstring for ws_shutdown_timer
2 parents 7e0deb8 + d201019 commit 5f5eaa2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

bittensor/core/async_subtensor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def __init__(
155155
retry_forever: bool = False,
156156
_mock: bool = False,
157157
archive_endpoints: Optional[list[str]] = None,
158-
websocket_shutdown_timer: float = 5.0,
158+
websocket_shutdown_timer: Optional[float] = 5.0,
159159
):
160160
"""Initializes an AsyncSubtensor instance for blockchain interaction.
161161
@@ -172,7 +172,9 @@ def __init__(
172172
cases where you are requesting a block that is too old for your current (presumably lite) node.
173173
Defaults to ``None``.
174174
websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to
175-
close the connection. Defaults to ``5.0``.
175+
close the connection. Passing `None` will disable to automatic shutdown process
176+
entirely.
177+
176178
Returns:
177179
None
178180

bittensor/core/subtensor_api/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class SubtensorApi:
3232
archive_endpoints: Similar to fallback_endpoints, but specifically only archive nodes. Will be used in cases
3333
where you are requesting a block that is too old for your current (presumably lite) node. Defaults to `None`
3434
websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to close
35-
the connection. Only applicable to AsyncSubtensor.
35+
the connection. Only applicable to AsyncSubtensor. If `None` is passed to this, the automatic shutdown
36+
process is disabled.
3637
3738
Example:
3839
# sync version
@@ -80,7 +81,7 @@ def __init__(
8081
log_verbose: bool = False,
8182
mock: bool = False,
8283
archive_endpoints: Optional[list[str]] = None,
83-
websocket_shutdown_timer: float = 5.0,
84+
websocket_shutdown_timer: Optional[float] = 5.0,
8485
):
8586
self.network = network
8687
self._fallback_endpoints = fallback_endpoints

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies = [
3535
"uvicorn",
3636
"bittensor-drand>=1.0.0,<2.0.0",
3737
"bittensor-wallet>=4.0.0,<5.0",
38-
"async-substrate-interface>=1.5.4"
38+
"async-substrate-interface>=1.5.6"
3939
]
4040

4141
[project.optional-dependencies]

0 commit comments

Comments
 (0)