mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-03-16 22:40:24 +00:00
Fail on start if any child threads can't start.
This commit is contained in:
parent
d7dde53bdc
commit
40d0bf27a6
2 changed files with 6 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ develop
|
|||
`python_platform_implementation` environment marker.
|
||||
* Moved repository to https://github.com/django-ddp/django-ddp (new
|
||||
Github organisation).
|
||||
* Fail on start if any child threads can't start (eg: port in use).
|
||||
* Add missing versions and dates to the change log, and note on Semantic
|
||||
Versioning.
|
||||
* Back to universal wheels, thanks to PEP-0496 environment markers.
|
||||
|
|
|
|||
|
|
@ -207,7 +207,12 @@ class DDPLauncher(object):
|
|||
self.print('=> Started PostgresGreenlet.')
|
||||
for server in self.servers:
|
||||
thread = gevent.spawn(server.serve_forever)
|
||||
gevent.sleep() # yield to thread in case it can't start
|
||||
self.threads.append(thread)
|
||||
if thread.dead:
|
||||
# thread died, stop everything and re-raise the exception.
|
||||
self.stop()
|
||||
thread.get()
|
||||
if isinstance(server, geventwebsocket.WebSocketServer):
|
||||
self.print(
|
||||
'=> App running at: %s://%s:%d/' % (
|
||||
|
|
|
|||
Loading…
Reference in a new issue