Skip to content

Commit 7fb09eb

Browse files
committed
connection.py: Rename timeout to timeout_left
This better conveys what this is: not a timeut duration from config, but how much of this timeout is left right now.
1 parent 75d361b commit 7fb09eb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cassandra/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,13 +1888,13 @@ def run(self):
18881888
self._raise_if_stopped()
18891889

18901890
# Wait max `self._timeout` seconds for all HeartbeatFutures to complete
1891-
timeout = self._timeout
1891+
timeout_left = self._timeout
18921892
start_time = time.time()
18931893
for f in futures:
18941894
self._raise_if_stopped()
18951895
connection = f.connection
18961896
try:
1897-
f.wait(timeout)
1897+
f.wait(timeout_left)
18981898
# TODO: move this, along with connection locks in pool, down into Connection
18991899
with connection.lock:
19001900
connection.in_flight -= 1
@@ -1904,7 +1904,7 @@ def run(self):
19041904
id(connection), connection.endpoint)
19051905
failed_connections.append((f.connection, f.owner, e))
19061906

1907-
timeout = self._timeout - (time.time() - start_time)
1907+
timeout_left = self._timeout - (time.time() - start_time)
19081908

19091909
for connection, owner, exc in failed_connections:
19101910
self._raise_if_stopped()

0 commit comments

Comments
 (0)