Skip to content

Commit

Permalink
Merge pull request #6776 from kozlovsky/fix/lock_file_not_found
Browse files Browse the repository at this point in the history
Handle race condition when deleting lock file
  • Loading branch information
kozlovsky authored Feb 21, 2022
2 parents 2e9e6ca + 2109cfc commit 7f667c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tribler-core/tribler_core/utilities/process_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ProcessChecker:
This class contains code to check whether a Tribler process is already running.
"""

def __init__(self, state_directory):
def __init__(self, state_directory: Path):
self.state_directory = state_directory
self.lock_file_path = self.state_directory / LOCK_FILE_NAME

Expand Down Expand Up @@ -58,7 +58,7 @@ def remove_lock_file(self):
Remove the lock file if it exists.
"""
if self.lock_file_path.exists():
self.lock_file_path.unlink()
self.lock_file_path.unlink(missing_ok=True)

def get_pid_from_lock_file(self):
"""
Expand Down

0 comments on commit 7f667c1

Please sign in to comment.