mirror of https://github.com/djcb/mu.git
parent
87187d15d6
commit
201fe45edc
|
@ -687,6 +687,9 @@ Server::Private::find_handler(const Command& cmd)
|
||||||
if (threads)
|
if (threads)
|
||||||
qflags |= QueryFlags::Threading;
|
qflags |= QueryFlags::Threading;
|
||||||
|
|
||||||
|
StopWatch sw{format("%s (indexing: %s)", __func__,
|
||||||
|
indexer().is_running() ? "yes" : "no")};
|
||||||
|
|
||||||
std::lock_guard l{store_.lock()};
|
std::lock_guard l{store_.lock()};
|
||||||
auto qres{store_.run_query(q, sort_field->id, qflags, maxnum)};
|
auto qres{store_.run_query(q, sort_field->id, qflags, maxnum)};
|
||||||
if (!qres)
|
if (!qres)
|
||||||
|
@ -778,6 +781,7 @@ Server::Private::index_handler(const Command& cmd)
|
||||||
|
|
||||||
// start a background track.
|
// start a background track.
|
||||||
index_thread_ = std::thread([this, conf = std::move(conf)] {
|
index_thread_ = std::thread([this, conf = std::move(conf)] {
|
||||||
|
StopWatch sw{"indexing"};
|
||||||
indexer().start(conf);
|
indexer().start(conf);
|
||||||
while (indexer().is_running()) {
|
while (indexer().is_running()) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||||
|
@ -1024,6 +1028,9 @@ Server::Private::view_mark_as_read(Store::Id docid, Message&& msg, bool rename)
|
||||||
void
|
void
|
||||||
Server::Private::view_handler(const Command& cmd)
|
Server::Private::view_handler(const Command& cmd)
|
||||||
{
|
{
|
||||||
|
StopWatch sw{format("%s (indexing: %s)", __func__,
|
||||||
|
indexer().is_running() ? "yes" : "no")};
|
||||||
|
|
||||||
const auto mark_as_read{cmd.boolean_arg(":mark-as-read")};
|
const auto mark_as_read{cmd.boolean_arg(":mark-as-read")};
|
||||||
/* for now, do _not_ rename, as it seems to confuse mbsync */
|
/* for now, do _not_ rename, as it seems to confuse mbsync */
|
||||||
const auto rename{false};
|
const auto rename{false};
|
||||||
|
|
|
@ -231,11 +231,11 @@ struct StopWatch {
|
||||||
{
|
{
|
||||||
const auto us{static_cast<double>(to_us(Clock::now() - start_))};
|
const auto us{static_cast<double>(to_us(Clock::now() - start_))};
|
||||||
if (us > 2000000)
|
if (us > 2000000)
|
||||||
g_debug("%s: finished after %0.1f s", name_.c_str(), us / 1000000);
|
g_debug("sw: %s: finished after %0.1f s", name_.c_str(), us / 1000000);
|
||||||
else if (us > 2000)
|
else if (us > 2000)
|
||||||
g_debug("%s: finished after %0.1f ms", name_.c_str(), us / 1000);
|
g_debug("sw: %s: finished after %0.1f ms", name_.c_str(), us / 1000);
|
||||||
else
|
else
|
||||||
g_debug("%s: finished after %g us", name_.c_str(), us);
|
g_debug("sw: %s: finished after %g us", name_.c_str(), us);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue