Sharing a lock between gunicorn workers

前端 未结 3 1718
南方客
南方客 2020-12-06 05:40

Is there a good way to share a multiprocessing Lock between gunicorn workers? I am trying to write a json API with Flask. Some of the API calls will interact a python class

3条回答
  •  独厮守ぢ
    2020-12-06 06:27

    I tried something, and it seems to work. I put preload_app = True in my gunicorn.conf and now the lock seems to be shared. I am still looking into exactly what's happening here but for now this is good enough, YMMV.

提交回复
热议问题