mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2026-06-13 04:04:59 +03:00
moved lock
This commit is contained in:
+12
-12
@@ -38,19 +38,7 @@ from urllib.parse import (
|
|||||||
quote
|
quote
|
||||||
)
|
)
|
||||||
|
|
||||||
LOCK_FILE = "/tmp/nslgamescanner.lock"
|
|
||||||
|
|
||||||
def single_instance():
|
|
||||||
global lockfile
|
|
||||||
lockfile = open(LOCK_FILE, "w")
|
|
||||||
|
|
||||||
try:
|
|
||||||
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
||||||
except BlockingIOError:
|
|
||||||
print("Another instance is already running. Exiting.")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
single_instance()
|
|
||||||
|
|
||||||
|
|
||||||
# Check the value of the DBUS_SESSION_BUS_ADDRESS environment variable
|
# Check the value of the DBUS_SESSION_BUS_ADDRESS environment variable
|
||||||
@@ -228,7 +216,19 @@ else:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LOCK_FILE = "/tmp/nslgamescanner.lock"
|
||||||
|
|
||||||
|
def single_instance():
|
||||||
|
global lockfile
|
||||||
|
lockfile = open(LOCK_FILE, "w")
|
||||||
|
|
||||||
|
try:
|
||||||
|
fcntl.flock(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
|
except BlockingIOError:
|
||||||
|
print("Another instance is already running. Exiting.")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
single_instance()
|
||||||
|
|
||||||
|
|
||||||
#Code
|
#Code
|
||||||
|
|||||||
Reference in New Issue
Block a user