diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 415f8d80..9ae18aa9 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -224,7 +224,9 @@ class TfElement extends LitElement { for (let id of ids_out_of_date) { if (!cache.about[id]?.seq) { - cache.about[id] = Object.assign(cache.about[id] ?? {}, {seq: users[id]?.seq ?? 0}); + cache.about[id] = Object.assign(cache.about[id] ?? {}, { + seq: users[id]?.seq ?? 0, + }); } } diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index 3639665f..00c9639e 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -1505,6 +1505,17 @@ static void _tf_ssb_rpc_delete_blobs_work(tf_ssb_t* ssb, void* user_data) int64_t timestamp = now - age * 1000ULL; const int k_limit = 128; int deleted = 0; + if (sqlite3_prepare(db, "DELETE FROM blob_wants_cache WHERE source IS NULL and timestamp < ?1", -1, &statement, NULL) == SQLITE_OK) + { + if (sqlite3_bind_int64(statement, 1, timestamp) == SQLITE_OK) + { + if (sqlite3_step(statement) != SQLITE_DONE) + { + tf_printf("Deleting stale blob wants cache entries: %s.\n", sqlite3_errmsg(db)); + } + } + sqlite3_finalize(statement); + } if (sqlite3_prepare(db, "DELETE FROM blobs WHERE blobs.id IN (" " SELECT blobs.id FROM blobs "