fix(nodes): fix #3306 (#3377)

Check if the cache has the object before deleting it.
This commit is contained in:
blessedcoolant 2023-05-10 17:39:45 +12:00 committed by GitHub
commit ad0b70ca23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,4 +270,5 @@ class DiskImageStorage(ImageStorageBase):
) # TODO: this should refresh position for LRU cache
if len(self.__cache) > self.__max_cache_size:
cache_id = self.__cache_ids.get()
del self.__cache[cache_id]
if cache_id in self.__cache:
del self.__cache[cache_id]