Skip to content

Commit

Permalink
Allow for the scenario where the pickle db file has been removed
Browse files Browse the repository at this point in the history
Some other EUPS process could remove the db file that was created
by this process.
  • Loading branch information
timj committed Jun 24, 2024
1 parent 07da1c7 commit d832a92
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python/eups/stack/ProductStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,15 @@ def save(self, flavors=None, dir=None):
raise CacheOutOfSync(outofsync)

def _cacheFileIsInSync(self, file):
return (file not in self.modtimes or
os.stat(file).st_mtime <= self.modtimes[file])
if file not in self.modtimes:
return True
try:
older = os.stat(file).st_mtime <= self.modtimes[file]
except FileNotFoundError:
# File must have been deleted by other eups process.
del self.modtimes[file]
return True
return older

def cacheIsInSync(self, flavors=None):
"""
Expand Down

0 comments on commit d832a92

Please sign in to comment.