mirror of https://github.com/djcb/mu.git
parent
901ac23a4d
commit
d79d770958
|
@ -586,8 +586,7 @@ docids_for_msgid(const Store& store, const std::string& msgid, size_t max = 100)
|
||||||
throw Error(Error::Code::Store, &gerr, "failed to run msgid-query");
|
throw Error(Error::Code::Store, &gerr, "failed to run msgid-query");
|
||||||
else if (res->empty())
|
else if (res->empty())
|
||||||
throw Error(Error::Code::NotFound,
|
throw Error(Error::Code::NotFound,
|
||||||
"could not find message(s) for msgid %s",
|
"could not find message(s) for msgid %s", msgid.c_str());
|
||||||
msgid.c_str());
|
|
||||||
|
|
||||||
std::vector<Store::Id> docids{};
|
std::vector<Store::Id> docids{};
|
||||||
for (auto&& mi : *res)
|
for (auto&& mi : *res)
|
||||||
|
|
|
@ -113,11 +113,9 @@ struct Store::Private {
|
||||||
|
|
||||||
std::unique_ptr<Xapian::Database> make_xapian_db(const std::string db_path, XapianOpts opts)
|
std::unique_ptr<Xapian::Database> make_xapian_db(const std::string db_path, XapianOpts opts)
|
||||||
try {
|
try {
|
||||||
|
|
||||||
/* we do our own flushing, set Xapian's internal one as the
|
/* we do our own flushing, set Xapian's internal one as the
|
||||||
* backstop*/
|
* backstop*/
|
||||||
g_setenv("XAPIAN_FLUSH_THRESHOLD",
|
g_setenv("XAPIAN_FLUSH_THRESHOLD", "500000", 1);
|
||||||
format("%zu", properties_.batch_size + 100).c_str(), 1);
|
|
||||||
|
|
||||||
switch (opts) {
|
switch (opts) {
|
||||||
case XapianOpts::ReadOnly:
|
case XapianOpts::ReadOnly:
|
||||||
|
@ -132,6 +130,11 @@ struct Store::Private {
|
||||||
throw std::logic_error("invalid xapian options");
|
throw std::logic_error("invalid xapian options");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (const Xapian::DatabaseLockError& xde) {
|
||||||
|
throw Mu::Error(Error::Code::StoreLock,
|
||||||
|
"failed to lock store @ %s: %s",
|
||||||
|
db_path.c_str(),
|
||||||
|
xde.get_msg().c_str());
|
||||||
} catch (const Xapian::DatabaseError& xde) {
|
} catch (const Xapian::DatabaseError& xde) {
|
||||||
throw Mu::Error(Error::Code::Store,
|
throw Mu::Error(Error::Code::Store,
|
||||||
"failed to open store @ %s: %s",
|
"failed to open store @ %s: %s",
|
||||||
|
|
Loading…
Reference in New Issue