Create the lockfile with our UID

This commit is contained in:
László Károlyi 2023-09-22 22:17:45 +02:00
parent 552c2270da
commit 77a1f669db
Signed by: karolyi
GPG key ID: 2DCAF25E55735BFE

View file

@ -1,9 +1,11 @@
from fcntl import LOCK_EX, LOCK_UN, flock
from os import getuid
from tempfile import gettempdir, gettempprefix
from .pathlib import Path
_KTOOLS_TEMPLOCK = Path(gettempdir(), f'{gettempprefix()}-ktools-lockfile')
_KTOOLS_TEMPLOCK = Path(
gettempdir(), f'{gettempprefix()}-ktools-lockfile-{getuid()}')
_KTOOLS_TEMPLOCK.touch(exist_ok=True)