Skip to content

Commit 1a5f8ea

Browse files
dvdkonwonder-sk
authored andcommitted
Re-read MerginProject state on creation/reuse
1 parent 112da7c commit 1a5f8ea

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

dbsync.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ def _get_mergin_project(work_path) -> MerginProject:
536536
"""
537537
if work_path not in cached_mergin_project_objects:
538538
cached_mergin_project_objects[work_path] = MerginProject(work_path)
539+
# Clear metadata so we re-read the state.
540+
# This is needed since otherwise we can have multiple MerginProject
541+
# instances of the same workpath with different state.
542+
cached_mergin_project_objects[work_path]._metadata = None
539543
cached_mergin_project_objects[work_path]._read_metadata()
540544
return cached_mergin_project_objects[work_path]
541545

0 commit comments

Comments
 (0)