Browse code

boobank-cacher: do not cache data-less results.

Xavier G authored on 26/11/2017 12:05:31
Showing 1 changed files

... ...
@@ -91,6 +91,9 @@ def write_cache(results):
91 91
     """
92 92
     for command in results.get('commands', []):
93 93
         if 'result' not in command or 'cache_path' not in command:
94
+            continue
95
+		# There is no point caching data-less results:
96
+        if 'data' not in command['result'] or not command['result']['data']:
94 97
             continue
95 98
         cache_path = os.path.expanduser(command['cache_path'])
96 99
         mkdir(os.path.dirname(cache_path), 0700)