From 9a8e9551b8bf1804b7cf150b6cacaa683da486cb Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Mon, 26 Jun 2023 21:14:48 -0700 Subject: [PATCH] Fix locking contention for #1697 (#1712) * Pull updating configs out of context * Update CHANGELOG.md --- CHANGELOG.md | 1 + covalent/_shared_files/config.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73602faa0..462aca72a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - File transfer strategy for GCP storage - Add CLI status for zombie, stopped process. +- Fix for double locking file in configurations. ### Docs diff --git a/covalent/_shared_files/config.py b/covalent/_shared_files/config.py index 636903053..763df818e 100644 --- a/covalent/_shared_files/config.py +++ b/covalent/_shared_files/config.py @@ -113,12 +113,12 @@ def update_nested_dict(old_dict, new_dict, override_existing: bool = True): fcntl.lockf(f, fcntl.LOCK_EX) file_config = toml.load(f) - update_nested_dict(self.config_data, file_config) - if new_entries: - update_nested_dict(self.config_data, new_entries, override_existing) + update_nested_dict(self.config_data, file_config) + if new_entries: + update_nested_dict(self.config_data, new_entries, override_existing) - # Writing it back to the file - self.write_config() + # Writing it back to the file + self.write_config() def read_config(self) -> None: """