From: Eric Wong Date: Wed, 11 Dec 2024 08:10:45 +0000 (+0000) Subject: lei/store: use global checkpoint interval X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720563af05167f33f7237c75ad74f62396ea16ca;p=thirdparty%2Fpublic-inbox.git lei/store: use global checkpoint interval 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. --- diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 3ae9f38f8..28eb57107 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 ...) ] }