Skip to content

Commit 8e8074d

Browse files
David HartmannJackUrb
David Hartmann
authored andcommitted
server: fix error 'has no attribute last_read_time'
1 parent f8bb7ad commit 8e8074d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

py/visdom/server/handlers/socket_handlers.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,16 @@ def socket_wrap_monitor_thread(self):
330330
# TODO mark wrapped subs and sources separately
331331
if len(self.subs) > 0 or len(self.sources) > 0:
332332
for sub in list(self.subs.values()):
333-
if time.time() - sub.last_read_time > MAX_SOCKET_WAIT:
333+
if (
334+
hasattr(sub, "last_read_time")
335+
and time.time() - sub.last_read_time > MAX_SOCKET_WAIT
336+
):
334337
sub.close()
335338
for sub in list(self.sources.values()):
336-
if time.time() - sub.last_read_time > MAX_SOCKET_WAIT:
339+
if (
340+
hasattr(sub, "last_read_time")
341+
and time.time() - sub.last_read_time > MAX_SOCKET_WAIT
342+
):
337343
sub.close()
338344
else:
339345
self.app.socket_wrap_monitor.stop()

0 commit comments

Comments
 (0)