How to lock a critical section in Django?

前端 未结 6 1489
礼貌的吻别
礼貌的吻别 2020-12-02 14:49

I can\'t find a good clean way to lock a critical section in Django. I could use a lock or semaphore but the python implementation is for threads only, so if the production

6条回答
  •  忘掉有多难
    2020-12-02 15:12

    You could use simple file locking as a mutual exclusion mechanism, see my recipe here. It won't suit all scenarios, but then you haven't said much about why you want to use this type of locking.

提交回复
热议问题