From b0359e1ea6f3e861a85c31066a452689e311d985 Mon Sep 17 00:00:00 2001 From: NoraGithub Date: Sat, 25 Nov 2017 23:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8python3=20=E5=92=8C=20pymongo?= =?UTF-8?q?=20=E4=B8=8D=E5=AF=BC=E8=87=B4=E8=BF=9B=E7=A8=8B=E9=98=BB?= =?UTF-8?q?=E5=A1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PyMongo supports Gevent. Simply call Gevent’s monkey.patch_all() before loading any other module http://api.mongodb.com/python/current/examples/gevent.html --- db/MongoHelper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/MongoHelper.py b/db/MongoHelper.py index 3ae5c80..5ade6b0 100644 --- a/db/MongoHelper.py +++ b/db/MongoHelper.py @@ -1,3 +1,6 @@ +from gevent import monkey +monkey.patch_all() + import pymongo from config import DB_CONFIG, DEFAULT_SCORE