Reinit Hub when using old version of gevent.

fix #654
This commit is contained in:
Anil V 2013-12-09 18:09:06 -08:00 committed by benoitc
parent 10fadf3d4a
commit 0daf25e816

View File

@ -174,9 +174,12 @@ class GeventWorker(AsyncWorker):
# monkey patch here
self.patch()
# reinit the hub
import gevent.core
gevent.core.reinit()
#gevent 0.13 and older doesn't reinitialize dns for us after forking
#here's the workaround
import gevent.core
gevent.core.dns_shutdown(fail_requests=1)
gevent.core.dns_init()
super(GeventWorker, self).init_process()