unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/4] lei/store: use global checkpoint interval
Date: Wed, 11 Dec 2024 08:10:45 +0000	[thread overview]
Message-ID: <20241211081047.1267062-3-e@80x24.org> (raw)
In-Reply-To: <20241211081047.1267062-1-e@80x24.org>

Maybe this can be made configurable at some point, but it
probably needs to be stored in the config since per-invocation
intervals won't work when multiple lei clients can be writing to
the lei/store.
---
 lib/PublicInbox/LeiStore.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 3ae9f38f..28eb5710 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -17,6 +17,7 @@ use v5.10.1;
 use parent qw(PublicInbox::Lock PublicInbox::IPC);
 use autodie qw(open pipe);
 use PublicInbox::ExtSearchIdx;
+use PublicInbox::SearchIdx;
 use PublicInbox::Eml;
 use PublicInbox::Import;
 use PublicInbox::InboxWritable qw(eml_from_path);
@@ -244,7 +245,8 @@ sub sto_export_kw ($$$) {
 # commit every 5s to get under the default DBD::SQLite timeout of 30s
 sub _schedule_checkpoint ($) {
 	my ($self) = @_;
-	add_uniq_timer("$self-checkpoint", 5, \&_commit, $self, 'barrier');
+	add_uniq_timer("$self-ckpt", $PublicInbox::SearchIdx::CHECKPOINT_INTVL,
+			\&_commit, $self, 'barrier');
 }
 
 # vmd = { kw => [ qw(seen ...) ], L => [ qw(inbox ...) ] }

  parent reply	other threads:[~2024-12-11  8:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11  8:10 [PATCH 0/4] various indexing updates Eric Wong
2024-12-11  8:10 ` [PATCH 1/4] (ext)index: use time-based commits to avoid busy timeout Eric Wong
2024-12-11  8:10 ` Eric Wong [this message]
2024-12-11  8:10 ` [PATCH 3/4] cindex: adjust estimated memory cost for deletes Eric Wong
2024-12-11  8:10 ` [PATCH 4/4] over_idx: simplify each_by_mid Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241211081047.1267062-3-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).