From 93458c4782c61714e48c40ebc322ab5b2c813aeb Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Fri, 19 May 2023 09:03:15 +0200 Subject: [PATCH] Allow custom timeout for db locking --- web/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/db.py b/web/db.py index 60df669..1cdee76 100644 --- a/web/db.py +++ b/web/db.py @@ -3,9 +3,9 @@ import json import pathlib import time -def lock(name): +def lock(name, timeout=5): lockfile = pathlib.Path.home() / f'{name}.lock' - for i in range(5): + for i in range(timeout): try: lockfile.symlink_to('/dev/null') return