windows igen
This commit is contained in:
@@ -368,13 +368,19 @@ class LibraryWatcher:
|
||||
except Exception as e:
|
||||
logger.error(f"Scan fejl: {library_path}: {e}")
|
||||
|
||||
def _path_accessible(self, path: Path, timeout_sec: float = 5.0) -> bool:
|
||||
def _path_accessible(self, path: Path, timeout_sec: float = 8.0) -> bool:
|
||||
"""Tjek om en sti er tilgængelig inden for timeout."""
|
||||
import threading
|
||||
result = [False]
|
||||
def check():
|
||||
try:
|
||||
result[0] = path.exists() and path.is_dir()
|
||||
import os, sys
|
||||
p = str(path)
|
||||
if sys.platform == "win32" and (p.startswith("\\\\") or p.startswith("//")):
|
||||
# UNC-stier på Windows — brug listdir der fungerer bedre
|
||||
os.listdir(p)
|
||||
result[0] = True
|
||||
else:
|
||||
result[0] = path.exists() and path.is_dir()
|
||||
except Exception:
|
||||
result[0] = False
|
||||
t = threading.Thread(target=check, daemon=True)
|
||||
|
||||
Reference in New Issue
Block a user