Skip to content

Commit

Permalink
replace the fcntl locker with portalocker to make os independent
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephine.Rutten committed Oct 9, 2024
1 parent 10f2f1a commit 687d393
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cnaas_nms/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 687d393

Please sign in to comment.