From 21f8ed7474041609573727b6d3c20ec606310a65 Mon Sep 17 00:00:00 2001 From: Stephen Ramsey Date: Thu, 21 Sep 2023 10:54:14 -0700 Subject: [PATCH] #2114 --- code/ARAX/ARAXQuery/Expand/kp_info_cacher.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/ARAX/ARAXQuery/Expand/kp_info_cacher.py b/code/ARAX/ARAXQuery/Expand/kp_info_cacher.py index 43bc7ed85..281a378d6 100644 --- a/code/ARAX/ARAXQuery/Expand/kp_info_cacher.py +++ b/code/ARAX/ARAXQuery/Expand/kp_info_cacher.py @@ -131,8 +131,11 @@ def load_kp_info_caches(self, log: ARAXResponse): this method. It ensures that caches are up to date and that they don't become corrupted while refreshing. """ - if (not self.both_caches_are_present()) or \ - os.path.exists(self.cache_refresh_pid_path): + + refresher_pid_exists = os.path.exists(self.cache_refresh_pid_path) + + if refresher_pid_exists: + # KP info cache is probably being regenerated log.info("the KP info cache is being refreshed; waiting for it") # if either pickled cache file is missing, then check if they are # being generated (on the other hand, if both exist, just move on @@ -154,8 +157,6 @@ def load_kp_info_caches(self, log: ARAXResponse): refresher_is_running = psutil.pid_exists(refresher_pid) cache_files_present = self.both_caches_are_present() - refresher_pid_exists = os.path.exists(self.cache_refresh_pid_path) - caches_being_refreshed = refresher_is_running and \ (refresher_pid_exists or (not cache_files_present))