Merge pull request #670 from ticosax/set-exit-code-on-error

In case of error when starting sanic
This commit is contained in:
Eli Uriegas 2017-05-01 15:16:02 -07:00 committed by GitHub
commit c35721abbd
2 changed files with 1 additions and 2 deletions

View File

@ -574,6 +574,7 @@ class Sanic:
except: except:
log.exception( log.exception(
'Experienced exception while trying to serve') 'Experienced exception while trying to serve')
raise
finally: finally:
self.is_running = False self.is_running = False
log.info("Server Stopped") log.info("Server Stopped")

View File

@ -522,5 +522,3 @@ def serve_multiple(server_settings, workers):
for process in processes: for process in processes:
process.terminate() process.terminate()
server_settings.get('sock').close() server_settings.get('sock').close()
asyncio.get_event_loop().stop()