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