Re: [PATCH 1/2] Add notmuch_database_flush method
authorAdrien Bustany <adrien@bustany.org>
Wed, 17 Oct 2012 21:34:08 +0000 (00:34 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:50 +0000 (09:49 -0800)
b3/a735b805c2f6485b3ed87cd6b57d0c47033235 [new file with mode: 0644]

diff --git a/b3/a735b805c2f6485b3ed87cd6b57d0c47033235 b/b3/a735b805c2f6485b3ed87cd6b57d0c47033235
new file mode 100644 (file)
index 0000000..f2fcc42
--- /dev/null
@@ -0,0 +1,99 @@
+Return-Path: <adrien@bustany.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 16FBA431FBD\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 14:34:14 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id kqvlYETZrCaa for <notmuch@notmuchmail.org>;\r
+       Wed, 17 Oct 2012 14:34:13 -0700 (PDT)\r
+Received: from mail.bustany.org (bustany.org [176.31.244.208])\r
+       by olra.theworths.org (Postfix) with ESMTP id 82C0A431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 14:34:13 -0700 (PDT)\r
+Received: from [192.168.1.147] (91-158-5-86.elisa-laajakaista.fi\r
+ [91.158.5.86])        by mail.bustany.org (Postfix) with ESMTPSA id 3C8761401ED;\r
+       Wed, 17 Oct 2012 23:37:59 +0200 (CEST)\r
+Message-ID: <507F2450.5020005@bustany.org>\r
+Date: Thu, 18 Oct 2012 00:34:08 +0300\r
+From: Adrien Bustany <adrien@bustany.org>\r
+User-Agent: Mozilla/5.0 (X11; Linux x86_64;\r
+       rv:16.0) Gecko/20121009 Thunderbird/16.0\r
+MIME-Version: 1.0\r
+To: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
+Subject: Re: [PATCH 1/2] Add notmuch_database_flush method\r
+References: <1342723401-26103-1-git-send-email-adrien@bustany.org>\r
+       <1342723401-26103-2-git-send-email-adrien@bustany.org>\r
+       <87d30h857w.fsf@betacantrips.com>\r
+In-Reply-To: <87d30h857w.fsf@betacantrips.com>\r
+Content-Type: text/plain; charset=ISO-8859-1; format=flowed\r
+Content-Transfer-Encoding: 8bit\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 17 Oct 2012 21:34:14 -0000\r
+\r
+Le 17/10/2012 18:53, Ethan Glasser-Camp a écrit :\r
+> Adrien Bustany <adrien@bustany.org> writes:\r
+>\r
+>> This method explicitly flushes the pending modifications to disk. It is\r
+>> useful if your program has various threads, each with a read only DB and\r
+>> one writer thread with a read/write DB. In that case, you most likely\r
+>> want the writer to sync the changes to disk so that the readers can see\r
+>> them, without having to close and reopen the database completely.\r
+>\r
+> These patches are pretty straightforward. But to conform to notmuch style..\r
+>\r
+>> +notmuch_status_t\r
+>> +notmuch_database_flush(notmuch_database_t *notmuch)\r
+>> +{\r
+>> +   notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;\r
+>\r
+> Indent is 4 spaces. (You have tabs here, which are 8 spaces, according\r
+> to devel/STYLE.)\r
+>\r
+>> +   try {\r
+>> +   if (notmuch->xapian_db != NULL &&\r
+>\r
+> if should be more indented than try. (So when you pull try back to 4\r
+> spaces, leave if at 8 spaces.)\r
+\r
+Sorry about that... I think I copied the style from \r
+notmuch_database_close, but my editor was set to have 4-space tabs, so I \r
+got confused. I'll send a fixed version of the patches.\r
+\r
+>\r
+>> +       notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE)\r
+>> +           (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();\r
+>\r
+> This line is 90 characters, and will remain at 86 once you indent using\r
+> the in-house style. I'm not sure if it's worth reformatting.\r
+> notmuch_database_close calls flush() using exactly the same 86-character\r
+> line. I'd say "don't make it worse", but personally I think breaking\r
+> this line might be worse.\r
+>\r
+\r
+Yes, I also think breaking this line will not make things prettier :-/\r
+\r
+> Ethan\r
+>\r
+\r
+Thanks for the review!\r
+\r
+Adrien\r