Skip to content

Commit

Permalink
Restore name "triblerd.lock" for lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Aug 12, 2022
1 parent 7cde3f6 commit de16ffa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tribler/core/utilities/process_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from tribler.core.utilities.path_util import Path


LOCK_FILE_NAME = 'triblerd.lock'


@contextmanager
def single_tribler_instance(directory: Path):
checker = ProcessChecker(directory)
Expand All @@ -28,9 +31,9 @@ class ProcessChecker:
This class contains code to check whether a Tribler process is already running.
"""

def __init__(self, directory: Path, lock_file_name: str = 'tribler.lock'):
def __init__(self, directory: Path, lock_file_name: Optional[str] = None):
self.logger = logging.getLogger(self.__class__.__name__)
self.lock_file = directory / lock_file_name
self.lock_file = directory / (lock_file_name or LOCK_FILE_NAME)
self.re_tribler = re.compile(r'tribler\b(?![/\\])')
self.logger.info(f'Lock file: {self.lock_file}')

Expand Down

0 comments on commit de16ffa

Please sign in to comment.