From 576b1684539f3e33f89c119f5b9a973b8c699ce4 Mon Sep 17 00:00:00 2001 From: Raphael Deem Date: Sat, 21 Jan 2017 14:37:37 -0800 Subject: [PATCH] set loop to None if multiple workers --- sanic/sanic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sanic/sanic.py b/sanic/sanic.py index cc362d2d..f891a761 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -390,6 +390,11 @@ class Sanic: """ server_settings['reuse_port'] = True + if server_settings['loop'] is not None: + log.warn("Passing the loop is not supported with multiple" + " workers. The loop paramater has been set to None.") + server_settings['loop'] = None + # Create a stop event to be triggered by a signal if stop_event is None: stop_event = Event()