Skip to content

Commit 4ab63fa

Browse files
authored
Merge pull request #727 from meyerlor/fix/network-drive-blocking-check
Fix blocking I/O on unavailable network drives during project checks
2 parents 64da89f + e0fc59b commit 4ab63fa

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

lizmap/project_checker_tools.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,15 @@ def project_safeguards_checks(
107107
# The layer is not file base.
108108
continue
109109

110-
layer_path = Path(components['path'])
111-
try:
112-
if not layer_path.exists():
113-
# Let's skip, QGIS is already warning this layer
114-
# Or the file might be a COG on Linux :
115-
# /vsicurl/https://demo.snap.lizmap.com/lizmap_3_6/cog/...
116-
continue
117-
except OSError:
118-
# Ticket https://github.com/3liz/lizmap-plugin/issues/541
119-
# OSError: [WinError 123] La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte:
120-
# '\\vsicurl\\https:\\XXX.lizmap.com\\YYY\\cog\\ZZZ.tif'
110+
# Use QGIS's already-resolved validity rather than probing the filesystem.
111+
# A fresh layer_path.exists() call blocks the main thread for the full OS
112+
# network timeout (~20-30s) on Windows when the layer source is on an
113+
# unavailable mapped or network drive.
114+
if not layer.isValid():
121115
continue
122116

117+
layer_path = Path(components['path'])
118+
123119
try:
124120
relative_path = relpath(layer_path, project_home)
125121
except ValueError:

0 commit comments

Comments
 (0)