Skip to content

Commit

Permalink
server: fix error 'has no attribute last_read_time'
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hartmann authored and JackUrb committed Mar 20, 2023
1 parent f8bb7ad commit 8e8074d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions py/visdom/server/handlers/socket_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,16 @@ def socket_wrap_monitor_thread(self):
# TODO mark wrapped subs and sources separately
if len(self.subs) > 0 or len(self.sources) > 0:
for sub in list(self.subs.values()):
if time.time() - sub.last_read_time > MAX_SOCKET_WAIT:
if (
hasattr(sub, "last_read_time")
and time.time() - sub.last_read_time > MAX_SOCKET_WAIT
):
sub.close()
for sub in list(self.sources.values()):
if time.time() - sub.last_read_time > MAX_SOCKET_WAIT:
if (
hasattr(sub, "last_read_time")
and time.time() - sub.last_read_time > MAX_SOCKET_WAIT
):
sub.close()
else:
self.app.socket_wrap_monitor.stop()
Expand Down

0 comments on commit 8e8074d

Please sign in to comment.