Answer the question
In order to leave comments, you need to log in
How to use mongoengine.connect when multiprocessing?
I have a module in my project that contains document models. At the end of the file there is a line from the official mongoengine documentation. connect(DB_HOST)
Further, all calls to this module occur inside tornado processes, for example
from core import models
...
owners = models.Owner.objects()
...
UserWarning: MongoClient opened before fork. Create MongoClient only after forking. See PyMongo's documentation for details: api.mongodb.org/python/current/faq.html#is-pymongo...
"MongoClient opened before fork. Create MongoClient only "
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question