aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Michal Sojka <sojkam1@fel.cvut.cz>2011-01-21 10:59:36 +0100
committerGravatar Carl Worth <cworth@cworth.org>2011-01-26 22:05:28 +1000
commit7c450905e41d9bc81aca82f4593a5b42a4bb8e31 (patch)
treed24be6058ba0f2e793949ae7cbe241ba543367b8
parentde2acbd49c8fdb0c5bc28513283a9e12eefdaca3 (diff)
new: Add all initial tags at once
If there are several tags applied to the new messages, it is beneficial to store them to the database at one, because it saves some time, especially when the notmuch new is run for the first time. This patch decreased the time for initial import from 1h 35m to 1h 14m.
-rw-r--r--notmuch-new.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index 7aa0674d..c4b7da38 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -418,10 +418,12 @@ add_files_recursive (notmuch_database_t *notmuch,
/* success */
case NOTMUCH_STATUS_SUCCESS:
state->added_messages++;
+ notmuch_message_freeze (message);
for (tag=state->new_tags; *tag != NULL; tag++)
notmuch_message_add_tag (message, *tag);
if (state->synchronize_flags == TRUE)
notmuch_message_maildir_flags_to_tags (message);
+ notmuch_message_thaw (message);
break;
/* Non-fatal issues (go on to next file) */
case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: