mu-server: implement temp-file optimization
It can be faster to feed big mu -> mu4e data, such as contacts are message headers through a temp-file instead directly though stdout; implement this, and add the server parameter --allow-temp-file. Implement this the "contacts" and "find" commands.
This commit is contained in:
@ -117,7 +117,10 @@ Mu::mu_cmd_server(const Mu::Options& opts) try {
|
||||
if (!store)
|
||||
return Err(store.error());
|
||||
|
||||
Server server{*store, output_sexp_stdout};
|
||||
Server::Options sopts{};
|
||||
sopts.allow_temp_file = opts.server.allow_temp_file;
|
||||
|
||||
Server server{*store, sopts, output_sexp_stdout};
|
||||
mu_message("created server with store @ {}; maildir @ {}; debug-mode {};"
|
||||
"readline: {}",
|
||||
store->path(), store->root_maildir(),
|
||||
|
||||
@ -498,6 +498,10 @@ sub_server(CLI::App& sub, Options& opts)
|
||||
sub.add_option("--eval", opts.server.eval,
|
||||
"Evaluate mu server expression")
|
||||
->excludes("--commands");
|
||||
sub.add_flag("--allow-temp-file", opts.server.allow_temp_file,
|
||||
"Allow for the temp-file optimization")
|
||||
->excludes("--commands");
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@ -222,6 +222,7 @@ struct Options {
|
||||
struct Server {
|
||||
bool commands; /**< dump docs for commands */
|
||||
std::string eval; /**< command to evaluate */
|
||||
bool allow_temp_file; /**< temp-file optimization allowed? */
|
||||
} server;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user