aboutsummaryrefslogtreecommitdiffstats
path: root/modules/extensions.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/extensions.py')
-rw-r--r--modules/extensions.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/extensions.py b/modules/extensions.py
index bc2c0450..1053253e 100644
--- a/modules/extensions.py
+++ b/modules/extensions.py
@@ -1,5 +1,6 @@
import os
import sys
+import threading
import traceback
import time
@@ -24,6 +25,8 @@ def active():
class Extension:
+ lock = threading.Lock()
+
def __init__(self, name, path, enabled=True, is_builtin=False):
self.name = name
self.path = path
@@ -42,8 +45,13 @@ class Extension:
if self.is_builtin or self.have_info_from_repo:
return
- self.have_info_from_repo = True
+ with self.lock:
+ if self.have_info_from_repo:
+ return
+ self.do_read_info_from_repo()
+
+ def do_read_info_from_repo(self):
repo = None
try:
if os.path.exists(os.path.join(self.path, ".git")):
@@ -70,6 +78,8 @@ class Extension:
print(f"Failed reading extension data from Git repository ({self.name}): {ex}", file=sys.stderr)
self.remote = None
+ self.have_info_from_repo = True
+
def list_files(self, subdir, extension):
from modules import scripts