diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2025-04-28 17:43:09 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2025-04-28 18:12:18 +0200 |
commit | 12c3c9ddbf6b3aa36c70fa90477d6ae8e132a230 (patch) | |
tree | c20a5a98d2adfaa64d3477bc765ccdb1452e51c1 /webmap-import | |
parent | a06c77784468f071508ee432c0b0f6d58accbc21 (diff) |
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.
Diffstat (limited to 'webmap-import')
-rwxr-xr-x | webmap-import | 2 |
1 files changed, 2 insertions, 0 deletions
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) |