From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oIU9OJJcqGCOAgAAgWs5BA (envelope-from ) for ; Sat, 22 May 2021 03:21:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EMzlM5JcqGD3NQAAB5/wlQ (envelope-from ) for ; Sat, 22 May 2021 01:21:22 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7237F1CD62 for ; Sat, 22 May 2021 03:21:22 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id A0BA529045; Fri, 21 May 2021 21:20:59 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 061F7271E8 for ; Fri, 21 May 2021 21:20:53 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id F2AD05FD25; Fri, 21 May 2021 21:20:52 -0400 (EDT) Received: (nullmailer pid 1412728 invoked by uid 1000); Sat, 22 May 2021 01:20:48 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 2/5] lib/config: add NOTMUCH_CONFIG_AUTOCOMMIT Date: Fri, 21 May 2021 22:20:37 -0300 Message-Id: <20210522012040.1412467-3-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210522012040.1412467-1-david@tethera.net> References: <20210522012040.1412467-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 3QGV5XJIAEYBRGIFZQVGTG7OJQQ4CXDG X-Message-ID-Hash: 3QGV5XJIAEYBRGIFZQVGTG7OJQQ4CXDG X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621646482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EgXwLKFvjHCEWR4/A0GREwV9P1b3LmxHO0HI3H1Iyv0=; b=M7IFAdwFGW6Pmk72ltMfpIgYkhXKEXGug17lDZpYVsCXDqtOKb5CXqqRRd1sxaOJh02QX6 22z3TLzbqVFDQX8jg8Jf5y/dv4EwE/SlBV7VqTW/hDgc9rx9sNp5fS2iCsqDhHlN/saHsu adPVOS5w/eqn2lsHsHtoVO7xafXoZfpfk7JOaZk/8qXOnvaGRLYaCO2CAi/C12fhkYIYoo Gkw6kZT9/8eMGgg2zCnbIOx7zYOewcmkoVh/kkpxKjD7Q/j5IWgnghXv5tEzAMI3d1B8TC WhvoE2QnJmPtxasaNaZks4F4pUKS0tVbJ0azgnsQ3pJff5QcoiObq+9bY0CrSg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621646482; a=rsa-sha256; cv=none; b=OtuxIFkWEvyp6Fa632P2/2YYKjpKHAh/jYzB4eJRag06m6DR4EFupZDOHWTxuQb+5q+AZf ph4Amlq7czfZRGhpZ2QP3RuP429fhBQkcUxofwybbampF/z+EnYPmr3XuJpL7Z6pMEPZS+ KCeuaqj80cShbmkaszHKi9SPnlVfPpgO5O7il6vGhyks1+vIgMaDY+UzuIbnIpjzf4WNkY gSsOxEkt5IhpspHjjaRLHYyQ/ywCa2ABBy4e/6GONF9YzwIW8dds6IY2hQb8Fz/c/fIbvk MgZOnuFDla8Qees7MuhWeP3PBBAqyGc3scFodpe+Ju01NAwuir2QJFKN4dHmjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 7237F1CD62 X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: MVKp3zjWCqmD This will be used to control how often atomic transactions are committed. --- lib/config.cc | 4 ++++ lib/notmuch.h | 1 + test/T030-config.sh | 1 + test/T055-path-config.sh | 1 + test/T590-libconfig.sh | 4 ++++ 5 files changed, 11 insertions(+) diff --git a/lib/config.cc b/lib/config.cc index 0ec66372..13eab5f1 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -593,6 +593,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key) return "user.other_email"; case NOTMUCH_CONFIG_USER_NAME: return "user.name"; + case NOTMUCH_CONFIG_AUTOCOMMIT: + return "database.autocommit"; default: return NULL; } @@ -638,6 +640,8 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key) return email; case NOTMUCH_CONFIG_NEW_IGNORE: return ""; + case NOTMUCH_CONFIG_AUTOCOMMIT: + return "8000"; case NOTMUCH_CONFIG_HOOK_DIR: case NOTMUCH_CONFIG_BACKUP_DIR: case NOTMUCH_CONFIG_OTHER_EMAIL: diff --git a/lib/notmuch.h b/lib/notmuch.h index 4b053932..5c3be342 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -2520,6 +2520,7 @@ typedef enum _notmuch_config_key { NOTMUCH_CONFIG_PRIMARY_EMAIL, NOTMUCH_CONFIG_OTHER_EMAIL, NOTMUCH_CONFIG_USER_NAME, + NOTMUCH_CONFIG_AUTOCOMMIT, NOTMUCH_CONFIG_LAST } notmuch_config_key_t; diff --git a/test/T030-config.sh b/test/T030-config.sh index 7a1660e9..751feaf3 100755 --- a/test/T030-config.sh +++ b/test/T030-config.sh @@ -51,6 +51,7 @@ cat < EXPECTED built_with.compact=something built_with.field_processor=something built_with.retry_lock=something +database.autocommit=8000 database.mail_root=MAIL_DIR database.path=MAIL_DIR foo.list=this;is another;list value; diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh index 8ef76aed..bb3bf665 100755 --- a/test/T055-path-config.sh +++ b/test/T055-path-config.sh @@ -259,6 +259,7 @@ EOF built_with.compact=true built_with.field_processor=true built_with.retry_lock=true +database.autocommit=8000 database.backup_dir database.hook_dir database.mail_root=MAIL_DIR diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index 745e1bb4..d922c3af 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -400,6 +400,7 @@ true USERNAME@FQDN NULL USER_FULL_NAME +8000 == stderr == EOF unset MAILDIR @@ -711,6 +712,7 @@ true test_suite@notmuchmail.org test_suite_other@notmuchmail.org;test_suite@otherdomain.org Notmuch Test Suite +8000 == stderr == EOF test_expect_equal_file EXPECTED OUTPUT @@ -742,6 +744,7 @@ true USERNAME@FQDN NULL USER_FULL_NAME +8000 == stderr == EOF test_expect_equal_file EXPECTED OUTPUT.clean @@ -808,6 +811,7 @@ EOF cat <<'EOF' >EXPECTED == stdout == aaabefore beforeval +database.autocommit 8000 database.backup_dir MAIL_DIR/.notmuch/backups database.hook_dir MAIL_DIR/.notmuch/hooks database.mail_root MAIL_DIR -- 2.30.2