mysql command out of sync when executing insert from celery

 ̄綄美尐妖づ 提交于 2019-12-06 08:18:46

First of all, make sure that the celery thingamajig uses its own connection(s) since

>>> pymysql.threadsafety
1

Which means: "threads may share the module but not connections".

Is the init called once, or per-worker? If only once, you need to move the initialisation.

How about lazily initialising the connection in a thread-local variable the first time query is called?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!