Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix case when free_after is an int in the lockfile instead of a string #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion xaux/protectfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _create_lock(self, lockfile=None, max_lock_time=None):
free_after = -1
if max_lock_time is not None:
free_after = int(time.time() + max_lock_time)
free_after = f"{free_after:15d}"[:15]
free_after = f"{free_after:15d}"[:15]
# We ensure that the variables in the lockfile always have a fixed number of characters
ran = random.randint(0, 2**63 - 1) + os.getpid() + int(time.time_ns() % 1e9)
self._ran = f"{ran:0>20d}"
Expand Down