]> git.notmuchmail.org Git - notmuch/commitdiff
lib: migrate to post Xapian 1.3.4 compact support
authorDavid Bremner <david@tethera.net>
Tue, 7 Jul 2020 10:56:45 +0000 (07:56 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 11 Jul 2020 20:20:09 +0000 (17:20 -0300)
The old API was deprecated in Xapian 1.3.4 and (will be) removed in 1.5.0

lib/database.cc

index 78b5fec921920c6fb3952417915c68aee10d7e8e..43bfac4e2216e4b56ec3652d1855e68089e25992 100644 (file)
@@ -1281,11 +1281,7 @@ notmuch_database_compact (const char *path,
 
     try {
        NotmuchCompactor compactor (status_cb, closure);
-
-       compactor.set_renumber (false);
-       compactor.add_source (xapian_path);
-       compactor.set_destdir (compact_xapian_path);
-       compactor.compact ();
+       notmuch->xapian_db->compact (compact_xapian_path, Xapian::DBCOMPACT_NO_RENUMBER, 0, compactor);
     } catch (const Xapian::Error &error) {
        _notmuch_database_log (notmuch, "Error while compacting: %s\n", error.get_msg ().c_str ());
        ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION;