[PATCH 2/3] Produce status messages during compacting
Jani Nikula
jani at nikula.org
Wed Oct 17 11:59:16 PDT 2012
Again, a commit message saying *why* having a flood of status messages
is a good idea would be appreciated. I'm not sure it is a good idea.
On Wed, 17 Oct 2012, Ben Gamari <bgamari.foss at gmail.com> wrote:
> ---
> lib/database.cc | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 6e83a61..49aa36d 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -780,11 +780,24 @@ notmuch_database_close (notmuch_database_t *notmuch)
> notmuch->value_range_processor = NULL;
> }
>
> +class NotmuchCompactor : public Xapian::Compactor
> +{
> +public:
> + virtual void
> + set_status (const std::string &table, const std::string &status)
> + {
> + if (status.length() == 0)
> + fprintf (stderr, "compacting table %s:\n", table.c_str());
It's not an error, so stderr seems wrong.
BR,
Jani.
> + else
> + fprintf (stderr, " %s\n", status.c_str());
> + }
> +};
> +
> void
> notmuch_database_close_compact (notmuch_database_t *notmuch)
> {
> void *local = talloc_new (NULL);
> - Xapian::Compactor compactor;
> + NotmuchCompactor compactor;
> char *notmuch_path, *xapian_path, *compact_xapian_path, *old_xapian_path;
>
> #if HAVE_XAPIAN_COMPACT
> --
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list