Fix another resource warning

This commit is contained in:
Kovid Goyal 2021-06-25 08:07:48 +05:30
parent 28fc61d74e
commit e699841551
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -326,10 +326,11 @@ class Worker(object):
if self.uses_ssl:
s = ssl.wrap_socket(s)
s.connect(('localhost', self.port))
s.close()
return
except socket.error:
time.sleep(0.01)
finally:
s.close()
self.log.error('Restarted server did not start listening on:', self.port)
# WebSocket reload notifier {{{