Check if relevant variables are not None before ping
This commit is contained in:
parent
84f62a11e6
commit
5cbf2eb917
1 changed files with 6 additions and 1 deletions
|
@ -1710,6 +1710,11 @@ class PesterWindow(MovingWindow):
|
||||||
self.sincerecv = 0
|
self.sincerecv = 0
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# We have IRC but we're missing a variable?
|
||||||
|
# gweh.jpg
|
||||||
|
if None in [self.lastCheckPing, self.sincerecv]:
|
||||||
|
return
|
||||||
|
|
||||||
# Desync check, happens if pc comes out of sleep.
|
# Desync check, happens if pc comes out of sleep.
|
||||||
currentTime = time.time()
|
currentTime = time.time()
|
||||||
timeDif = abs(currentTime - self.lastCheckPing)
|
timeDif = abs(currentTime - self.lastCheckPing)
|
||||||
|
@ -1722,7 +1727,7 @@ class PesterWindow(MovingWindow):
|
||||||
)
|
)
|
||||||
% (timeDif, currentTime, self.lastCheckPing)
|
% (timeDif, currentTime, self.lastCheckPing)
|
||||||
)
|
)
|
||||||
self.sincerecv = 85 # Allows one more ping attempt before disconnect.
|
self.sincerecv = 80 # Allows 2 more ping attempts before disconnect.
|
||||||
self.lastCheckPing = time.time()
|
self.lastCheckPing = time.time()
|
||||||
|
|
||||||
# Presume connection is dead after 90 seconds of silence.
|
# Presume connection is dead after 90 seconds of silence.
|
||||||
|
|
Loading…
Reference in a new issue