[damned-lies] Made the lock dir configurable by a setting
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Made the lock dir configurable by a setting
- Date: Mon, 16 Sep 2019 09:57:50 +0000 (UTC)
commit 49ce3f5659d6ac092cc965a4a2243836ee5679a9
Author: Claude Paroz <claude 2xlibre net>
Date: Mon Sep 16 11:57:24 2019 +0200
Made the lock dir configurable by a setting
damnedlies/settings.py | 2 ++
stats/models.py | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/damnedlies/settings.py b/damnedlies/settings.py
index 443c36fa..82ae1528 100644
--- a/damnedlies/settings.py
+++ b/damnedlies/settings.py
@@ -203,6 +203,8 @@ GETTEXT_ITS_DATA = {
GITLAB_TOKEN = 'fill_with_real_token'
+LOCK_DIR = '/var/lock'
+
try:
from .local_settings import *
except ImportError:
diff --git a/stats/models.py b/stats/models.py
index 85e0eb14..0497efc2 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -173,7 +173,7 @@ class ModuleLock:
def __init__(self, mod):
assert isinstance(mod, Module)
self.module = mod
- self.dirpath = os.path.join("/var/lock", "updating-%s" % self.module.name)
+ self.dirpath = os.path.join(settings.LOCK_DIR, "updating-%s" % self.module.name)
def __enter__(self):
while True:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]