123 @type str |
124 @type str |
124 @return dictionary containing the requested vulnerability data |
125 @return dictionary containing the requested vulnerability data |
125 @rtype dict |
126 @rtype dict |
126 """ |
127 """ |
127 if os.path.exists(self.__cacheFile): |
128 if os.path.exists(self.__cacheFile): |
128 with open(self.__cacheFile, "r") as f: |
129 with open(self.__cacheFile, "r") as f: # __IGNORE_WARNING_Y117__ |
129 with contextlib.suppress(json.JSONDecodeError, OSError): |
130 with contextlib.suppress(json.JSONDecodeError, OSError): |
130 cachedData = json.load(f) |
131 cachedData = json.load(f) |
131 if ( |
132 if ( |
132 dbName in cachedData and |
133 dbName in cachedData and |
133 "cachedAt" in cachedData[dbName] |
134 "cachedAt" in cachedData[dbName] |