fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Apache License 2.0
9.93k stars 1.13k forks source link

Minor Fix in Server: fix error "has no attribute 'last_read_time'" #912

Closed da-h closed 1 year ago

da-h commented 1 year ago

Description

I noticed that the last tests threw the following error when using the -use_frontend_client_polling option:

 ERROR:tornado.application:Exception in callback <bound method SocketWrapper.socket_wrap_monitor_thread of <visdom.server.handlers.socket_handlers.SocketWrapper object at 0x7efec864b670>>
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/tornado/ioloop.py", line 921, in _run
    val = self.callback()
  File "/home/runner/work/visdom/visdom/py/visdom/server/handlers/socket_handlers.py", line 336, in socket_wrap_monitor_thread
    if time.time() - sub.last_read_time > MAX_SOCKET_WAIT:

(e.g. here)

This PR is a simple fix for this error, by checking if the variable exists.

Types of changes

Checklist: