Skip to content

Commit

Permalink
use gevent monkey-patching when the reloader is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Nov 30, 2014
1 parent 61d835e commit 2e7e050
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flask_socketio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ def run(self, app, host=None, port=None, **kwargs):
self.server = SocketIOServer((host, port), app.wsgi_app,
resource='socket.io', **kwargs)
if app.debug:
# monkey patching is required by the reloader
from gevent import monkey
monkey.patch_all()

def run_server():
self.server.serve_forever()
if os.environ.get('WERKZEUG_RUN_MAIN') != 'true':
Expand Down

0 comments on commit 2e7e050

Please sign in to comment.