官方documentation|https://docs.openstack.org/oslo.concurrency/latest/user/让它看起来是这样的:
from oslo_concurrency import lockutils
...
@lockutils.synchronized('myLock', external=True)
def my-function():
pass然而,一旦我运行了我的应用程序,我就会得到这个错误:
value required for option lock_path in group default发布于 2021-02-25 18:04:27
因为您设置了external=True,所以lockutils需要一个临时目录来保存信息。您可以使用以下命令全局设置lock_path:
lockutils.set_defaults(lock_path='/home/user/tmp/')那么lockutils应该可以工作了。
有关如何使用oslo_concurrency.lockutils的更多信息,请访问以下链接:https://docs.openstack.org/oslo.concurrency/latest/reference/lockutils.html
https://stackoverflow.com/questions/62575843
复制相似问题