Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MailMover: Only run 'notmuch new' if any mails were actually moved #150

Merged
merged 1 commit into from
Jul 16, 2017

Conversation

tohojo
Copy link
Contributor

@tohojo tohojo commented Jul 12, 2017

When running afew --move, the notmuch database is always updated, even if not
files were actually moved. Since this takes a non-trivial amount of time, the
time to run afew can actually be dominated by the database update, which is
annoying when putting afew into an automated 'check new mails' hook.

This adds a small optimisation where the database is only updated if any
messages were actually moved. This makes running afew --move substantially
faster in the common case were no messages need to be moved.

I realise this pull requests conflicts with some of the other open pull requests
that also touch MailMover; but since this one is fairly small, it should be
simple to incorporate in those as well :)

When running `afew --move`, the notmuch database is always updated, even if not
files were actually moved. Since this takes a non-trivial amount of time, the
time to run afew can actually be dominated by the database update, which is
annoying when putting afew into an automated 'check new mails' hook.

This adds a small optimisation where the database is only updated if any
messages were actually moved. This makes running `afew --move` substantially
faster in the common case were no messages need to be moved.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
@GuillaumeSeren
Copy link
Collaborator

Hey @tohojo thank for sharing this patch,
to me it is fine and as I heavily use this option saving to update the database if no mail was moved can save a bit of cpu / ssd.

I let other maintainer have a look but I think this could be merged.

@GuillaumeSeren
Copy link
Collaborator

@flokli Can you have a look ?

@flokli flokli merged commit b70d798 into afewmail:master Jul 16, 2017
@flokli
Copy link
Member

flokli commented Jul 16, 2017

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants