about summary refs log tree commit homepage
path: root/lib/PublicInbox/IdxStack.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-11-13 11:11:44 +0000
committerEric Wong <e@80x24.org>2020-11-15 06:12:43 +0000
commit7d42724e82c9e0ecfa07154c7a56e7f21e53e62f (patch)
tree6755566e109457ffcef08f3acb3b9301bb0dd858 /lib/PublicInbox/IdxStack.pm
parent834181c640236c91f367de04d5cc9834ec617f4e (diff)
downloadpublic-inbox-7d42724e82c9e0ecfa07154c7a56e7f21e53e62f.tar.gz
Just like the daemon processes, -extindex now supports graceful
shutdown via the same signals.  This lets users avoid having to
repeat indexing messages when a power outage strikes during a
long (multi-hour/day) indexing run.

Per-inbox (v1/v2) -index graceful shutdowns are not supported,
yet, but is planned for later.
Diffstat (limited to 'lib/PublicInbox/IdxStack.pm')
-rw-r--r--lib/PublicInbox/IdxStack.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/IdxStack.pm b/lib/PublicInbox/IdxStack.pm
index e7e10de9..c55c5c36 100644
--- a/lib/PublicInbox/IdxStack.pm
+++ b/lib/PublicInbox/IdxStack.pm
@@ -11,6 +11,8 @@ use constant PACK_FMT => eval { pack('Q', 1) } ? 'A1QQH*H*' : 'A1IIH*H*';
 # start off in write-only mode
 sub new {
         open(my $io, '+>', undef) or die "open: $!";
+        # latest_cmt is still useful when the newest revision is a `d'(elete),
+        # otherwise we favor $sync->{latest_cmt} for checkpoints and {quit}
         bless { wr => $io, latest_cmt => $_[1] }, __PACKAGE__
 }