diff options
author | Eric Wong <e@80x24.org> | 2020-11-13 11:11:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-11-15 06:12:43 +0000 |
commit | 7d42724e82c9e0ecfa07154c7a56e7f21e53e62f (patch) | |
tree | 6755566e109457ffcef08f3acb3b9301bb0dd858 /lib/PublicInbox/IdxStack.pm | |
parent | 834181c640236c91f367de04d5cc9834ec617f4e (diff) | |
download | public-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.pm | 2 |
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__ } |