1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-11-22 10:01:27 +03:00

Fix cache invalidation (#324)

This commit is contained in:
Igor Chubin 2022-04-18 15:59:17 +00:00
parent 5671e7d0d9
commit e66382cb53

View File

@ -58,8 +58,8 @@ def fetch_all(skip_existing=True):
sys.stdout.flush() sys.stdout.flush()
try: try:
process = subprocess.Popen( process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
universal_newlines=True) universal_newlines=True)
except OSError: except OSError:
print("\nERROR: %s" % cmd) print("\nERROR: %s" % cmd)
raise raise
@ -149,9 +149,11 @@ def _update_adapter(adptr):
if entries: if entries:
_log("%s Entries to be updated: %s", adptr, len(entries)) _log("%s Entries to be updated: %s", adptr, len(entries))
name = adptr.name()
for entry in entries: for entry in entries:
_log("+ ivalidating %s", entry) cache_name = name + ":" + entry
cache.delete(entry) _log("+ invalidating %s", cache_name)
cache.delete(cache_name)
if entries: if entries:
_log("Done") _log("Done")