Skip to content

Commit

Permalink
Merge pull request #55 from edieterich/remove-deleted-db-from-interna…
Browse files Browse the repository at this point in the history
…l-hash-table

Remove deleted DB from internal hash table
  • Loading branch information
slusarz authored Feb 24, 2024
2 parents 72bd5f3 + 11fd0dc commit 2dc299e
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 2dc299e

Please sign in to comment.