mirror of
https://github.com/jaxperro/winning-wallet-finder.git
synced 2026-07-28 00:07:47 +00:00
recorder: reset freshness clock on reconnect (insta-close loop bug) + 45s stale guard — cuts per-flap tape loss
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,8 @@ def main():
|
|||||||
while True:
|
while True:
|
||||||
def on_open(ws):
|
def on_open(ws):
|
||||||
ws.send(SUB)
|
ws.send(SUB)
|
||||||
|
tape.last_msg = time.time() # fresh clock — a stale one from the
|
||||||
|
# PREVIOUS connection would trip the guard instantly and loop
|
||||||
log("rtds: connected — recording unfiltered trades")
|
log("rtds: connected — recording unfiltered trades")
|
||||||
|
|
||||||
def ping():
|
def ping():
|
||||||
@@ -105,8 +107,8 @@ def main():
|
|||||||
ws.send('{"action":"ping"}')
|
ws.send('{"action":"ping"}')
|
||||||
except Exception:
|
except Exception:
|
||||||
break
|
break
|
||||||
if time.time() - tape.last_msg > 120:
|
if time.time() - tape.last_msg > 45:
|
||||||
log("rtds: silent 120s — forcing reconnect")
|
log("rtds: silent 45s — forcing reconnect")
|
||||||
tape.gaps += 1
|
tape.gaps += 1
|
||||||
try:
|
try:
|
||||||
ws.close()
|
ws.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user