]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei/store: use global checkpoint interval
authorEric Wong <e@80x24.org>
Wed, 11 Dec 2024 08:10:45 +0000 (08:10 +0000)
committerEric Wong <e@80x24.org>
Thu, 12 Dec 2024 08:44:14 +0000 (08:44 +0000)
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

index 3ae9f38f875c78ce8524d31509607edc24d3d0ce..28eb57107be55608f4346e81536d6ca0061699ef 100644 (file)
@@ -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 ...) ] }