From 77a1f669dbcf6dfec1b280660e99e34185292359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20K=C3=A1rolyi?= Date: Fri, 22 Sep 2023 22:17:45 +0200 Subject: [PATCH] Create the lockfile with our UID --- src/ktools/locks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ktools/locks.py b/src/ktools/locks.py index 3f49576..b2e6213 100644 --- a/src/ktools/locks.py +++ b/src/ktools/locks.py @@ -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)