Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
saramsey committed Sep 21, 2023
1 parent 983662d commit 21f8ed7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions code/ARAX/ARAXQuery/Expand/kp_info_cacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))

Expand Down

0 comments on commit 21f8ed7

Please sign in to comment.