mirror of
https://github.com/jazzband/django-ddp.git
synced 2026-05-10 08:35:04 +00:00
Don't barf on multiple invocations of greenify().
This commit is contained in:
parent
2ad5e28452
commit
16e48e50be
1 changed files with 2 additions and 3 deletions
|
|
@ -26,10 +26,9 @@ REMOVED = 'removed'
|
|||
|
||||
def greenify():
|
||||
"""Patch threading and psycopg2 modules for green threads."""
|
||||
if 'threading' in sys.modules:
|
||||
from gevent.monkey import patch_all, saved
|
||||
if ('threading' in sys.modules) and ('threading' not in saved):
|
||||
raise Exception('threading module loaded before patching!')
|
||||
|
||||
from gevent.monkey import patch_all
|
||||
patch_all()
|
||||
|
||||
from psycogreen.gevent import patch_psycopg
|
||||
|
|
|
|||
Loading…
Reference in a new issue