From 60c3fbc5cede6552a830009de8140a980082ba9a Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Mon, 19 Dec 2016 21:49:14 +0000 Subject: [PATCH] Don't cache failures and add additional logging for the long schema validation pause. --- volatility/schemas/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/volatility/schemas/__init__.py b/volatility/schemas/__init__.py index 28ec15e96..6020cb46e 100644 --- a/volatility/schemas/__init__.py +++ b/volatility/schemas/__init__.py @@ -51,7 +51,10 @@ def valid(input, schema, use_cache = True): return True try: import jsonschema + vollog.debug("Validating JSON against schema...") jsonschema.validate(input, schema) + cached_validations.add(input_hash) + vollog.debug("JSON validated against schema (result cached)") except ImportError: vollog.info("Dependency for validation unavailable: jsonschema") vollog.debug("All validations will report success, even with malformed input") @@ -59,6 +62,5 @@ def valid(input, schema, use_cache = True): except: vollog.debug("Schema validation error", exc_info = True) return False - cached_validations.add(input_hash) record_cached_validations(cached_validations) return True