Skip to content

Commit

Permalink
moved gevent monkey_patch to top due to bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-ki authored Jun 8, 2018
1 parent 43c9336 commit 11dda4b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python/loom_viewer/loom_server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Needed before other imports of ssl, socket, time etc.:
import gevent.monkey
gevent.monkey.patch_all()

from typing import *
from mypy_extensions import NoReturn

Expand All @@ -23,7 +27,7 @@

import socket

import gevent.monkey
#import gevent.monkey
import gevent.socket
import gevent.wsgi

Expand Down Expand Up @@ -316,9 +320,9 @@ def start_server(dataset_path: str=None, show_browser: bool=True, port: int=8003
webbrowser.open(url)
try:
# self.app.run(threaded=True, debug=debug, host="0.0.0.0", port=port)
# Monkey-patch if this has not happened yet
if socket.socket is not gevent.socket.socket:
gevent.monkey.patch_all()
## Monkey-patch if this has not happened yet
#if socket.socket is not gevent.socket.socket:
# gevent.monkey.patch_all()
http_server = gevent.wsgi.WSGIServer(('', port), loom_server.app)

http_server.serve_forever()
Expand Down

0 comments on commit 11dda4b

Please sign in to comment.