Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"properties": {
"start": { "type": ["string", "null"] },
"duration": { "type": ["number", "null"] },
"durationInMinutes": { "type": ["number", "null"] },
"rrule": { "type": ["string", "null"] }
}
},
Expand Down
7 changes: 5 additions & 2 deletions python/idsse_common/idsse/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def expired(self) -> bool:
# Linux (and maybe Windows) don't support birthtime
creation_time = os.stat(self._lock_path).st_ctime
except FileNotFoundError:
# lock file disappeared since start of function call?? *shrug* treat it as unexpired
# lock file disappeared since start of function call?? Treat it as unexpired
creation_time = datetime.now(UTC).timestamp()
return (datetime.now(UTC).timestamp() - creation_time) >= self._max_age

Expand Down Expand Up @@ -198,7 +198,10 @@ def release(self) -> bool:
"""Release the lock so other processes/threads can do I/O"""
if not self.locked:
return False
os.remove(self._lock_path)
try:
os.remove(self._lock_path)
except FileNotFoundError:
pass # lock file disappeared since start of function call?? Treat it as released
return True

def _create_lockfile(self):
Expand Down
Loading