Skip to content

Commit

Permalink
Remove deleted DB from internal hash table
Browse files Browse the repository at this point in the history
  • Loading branch information
edieterich committed Feb 22, 2024
1 parent b3df9a8 commit 11fd0dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fts-backend-flatcurve-xapian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,11 @@ fts_flatcurve_xapian_read_db(struct flatcurve_fts_backend *backend,
iter = hash_table_iterate_init(x->dbs);
while (hash_table_iterate(iter, x->dbs, &key, &val)) {
xdb = (struct flatcurve_xapian_db *)val;
if (!fts_flatcurve_xapian_db_read_add(backend, xdb))
if (!fts_flatcurve_xapian_db_read_add(backend, xdb)) {
/* If we can't open a DB, delete it. */
fts_flatcurve_xapian_delete(backend, xdb->dbpath);
hash_table_remove(x->dbs, key);
}
}
hash_table_iterate_deinit(&iter);

Expand Down

0 comments on commit 11fd0dc

Please sign in to comment.