+ %$self = (filename => $dbh->sqlite_db_filename, pid => $pid);
+}
+
+sub skip_artnum {
+ my ($self, $skip_artnum) = @_;
+ return meta_accessor($self, 'skip_artnum') if !defined($skip_artnum);
+
+ my $cur = num_highwater($self) // 0;
+ if ($skip_artnum < $cur) {
+ die "E: current article number $cur ",
+ "exceeds --skip-artnum=$skip_artnum\n";
+ } else {
+ my $ok;
+ for (1..10) {
+ my $mid = 'skip'.rand.'@'.rand.'.example.com';
+ $ok = mid_set($self, $skip_artnum, $mid);
+ if ($ok) {
+ mid_delete($self, $mid);
+ last;
+ }
+ }
+ $ok or die '--skip-artnum failed';
+
+ # in the future, the indexer may use this value for
+ # new messages in old epochs
+ meta_accessor($self, 'skip_artnum', $skip_artnum);
+ }
+}
+
+sub check_inodes {
+ my ($self) = @_;
+ # no filename if in-:memory:
+ my $f = $self->{dbh}->sqlite_db_filename // return;
+ if (my @st = stat($f)) { # did st_dev, st_ino change?
+ my $st = pack('dd', $st[0], $st[1]);
+ if ($st ne ($self->{st} // $st)) {
+ my $tmp = eval { ref($self)->new_file($f) };
+ if ($@) {
+ warn "E: DBI->connect($f): $@\n";
+ } else {
+ %$self = %$tmp;
+ }
+ }
+ } else {
+ warn "W: stat $f: $!\n";
+ }