Skip to content

Commit 5e375cc

Browse files
bjmbmambocab
authored andcommitted
remove eager callback execution in timer
With our fix for PYTHON-755, you can now start timers with a negative timeout in cluster.Cluster._start_timer. When this happens, Timer.callback can be called twice, once in Timer.__init__ and once in Timer.finish. The first is just an optimization, so we remove it here.
1 parent 7b500f7 commit 5e375cc

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

cassandra/connection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,6 @@ class Timer(object):
10321032
def __init__(self, timeout, callback):
10331033
self.end = time.time() + timeout
10341034
self.callback = callback
1035-
if timeout < 0:
1036-
self.callback()
10371035

10381036
def __lt__(self, other):
10391037
return self.end < other.end

0 commit comments

Comments
 (0)