Skip to content
Snippets Groups Projects
Verified Commit aae9903e authored by Tomas Krizek's avatar Tomas Krizek Committed by Petr Špaček
Browse files

utils/kr_cache_gc: skip invalid entries during iteration

parent b0ecdee9
Branches
Tags
1 merge request!817cache garbage collector
......@@ -157,12 +157,14 @@ int kr_gc_cache_iter(knot_db_t *knot_db, kr_gc_iter_callback callback, void *ctx
if (entry_type != NULL) {
struct entry_h *entry = entry_h_consistent(val, *entry_type);
info.rrtype = *entry_type;
info.entry_size = key.len + val.len;
info.expires_in = entry->time + entry->ttl - now;
info.no_labels = entry_labels(&key);
if (entry != NULL) {
info.rrtype = *entry_type;
info.entry_size = key.len + val.len;
info.expires_in = entry->time + entry->ttl - now;
info.no_labels = entry_labels(&key);
ret = callback(&key, &info, ctx);
ret = callback(&key, &info, ctx);
}
}
if (ret != KNOT_EOK) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment