diff --git a/src/cnaas_nms/scheduler/scheduler.py b/src/cnaas_nms/scheduler/scheduler.py index c59e03af..ac4e5cbe 100644 --- a/src/cnaas_nms/scheduler/scheduler.py +++ b/src/cnaas_nms/scheduler/scheduler.py @@ -36,8 +36,8 @@ def __init__(self): # If scheduler is already started, use uwsgi ipc to send job to mule process self.lock_f = open("/tmp/scheduler.lock", "w") try: - portalocker.Lock(self.lock_f, flags=portalocker.LOCK_EX | portalocker.LOCK_NB) - except BlockingIOError: + portalocker.lock(self.lock_f, flags=portalocker.LOCK_EX | portalocker.LOCK_NB) + except portalocker.exceptions.LockException: try: import uwsgi # noqa: F401 except Exception: