Create the lockfile with our UID
This commit is contained in:
parent
552c2270da
commit
77a1f669db
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue