From 12c3c9ddbf6b3aa36c70fa90477d6ae8e132a230 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 28 Apr 2025 17:43:09 +0200 Subject: webmap-import: Fix fd leak, open lockfiles only once. Some layers, for instance svk:*, use the same source file, and we want a single lock per file. --- webmap-import | 2 ++ 1 file changed, 2 insertions(+) (limited to 'webmap-import') diff --git a/webmap-import b/webmap-import index 80f918e..c930730 100755 --- a/webmap-import +++ b/webmap-import @@ -525,6 +525,8 @@ def lockSourcePaths(layerdefs : dict[str,Any], lockdir: str) -> dict[str,int]: for layerdef in layerdefs: for source in layerdef['sources']: source_path = source['source']['path'] + if source_path in ret: + continue lockfile = getSourcePathLockFileName(source_path) lock_fd = os.open(lockfile, O_WRONLY|O_CREAT|O_CLOEXEC, mode=0o664, dir_fd=lockdir_fd) -- cgit v1.2.3