Overwriting existing destinations safe (but slow) by default,
so show a progress message noting what we're doing while
a user waits.
# fast (spawn compressor or mkdir), runs in same process as pre_augment
sub post_augment {
my ($self, $lei, @args) = @_;
# fast (spawn compressor or mkdir), runs in same process as pre_augment
sub post_augment {
my ($self, $lei, @args) = @_;
+ $self->{-au_noted}++ and $lei->qerr("# writing to $self->{dst} ...");
+
my $wait = $lei->{opt}->{'import-before'} ?
$lei->{sto}->wq_do('checkpoint', 1) : 0;
# _post_augment_mbox
my $wait = $lei->{opt}->{'import-before'} ?
$lei->{sto}->wq_do('checkpoint', 1) : 0;
# _post_augment_mbox
$lei->{pkt_op_p}->pkt_do('l2m_progress', $nr);
}
$lei->{pkt_op_p}->pkt_do('l2m_progress', $nr);
}
+# runs on a 1s timer in lei-daemon
+sub augment_inprogress {
+ my ($err, $opt, $dst, $au_noted) = @_;
+ $$au_noted++ and return;
+ print $err '# '.($opt->{'import-before'} ?
+ "importing non-external contents of $dst" : (
+ ($opt->{dedupe} // 'content') ne 'none') ?
+ "scanning old contents of $dst for dedupe" :
+ "removing old contents of $dst")." ...\n";
+}
+
# called in top-level lei-daemon when LeiAuth is done
sub net_merge_all_done {
# called in top-level lei-daemon when LeiAuth is done
sub net_merge_all_done {
+ my ($self, $lei) = @_;
+ if ($PublicInbox::DS::in_loop &&
+ $self->can("_do_augment_$self->{base_type}") &&
+ !$lei->{opt}->{quiet}) {
+ $self->{-au_noted} = 0;
+ PublicInbox::DS::add_timer(1, \&augment_inprogress,
+ $lei->{2}, $lei->{opt},
+ $self->{dst}, \$self->{-au_noted});
+ }
$self->wq_broadcast('do_post_auth');
$self->wq_close(1);
}
$self->wq_broadcast('do_post_auth');
$self->wq_close(1);
}
$self->{opt_sort} = $lei->{opt}->{'sort'};
$self->{-do_lcat} = !!(delete $lei->{lcat_todo});
if ($l2m) {
$self->{opt_sort} = $lei->{opt}->{'sort'};
$self->{-do_lcat} = !!(delete $lei->{lcat_todo});
if ($l2m) {
- $l2m->net_merge_all_done unless $lei->{auth};
+ $l2m->net_merge_all_done($lei) unless $lei->{auth};
} else {
start_query($self);
}
} else {
start_query($self);
}
$ino_fdinfo or skip 'Linux/inotify-only removal removal', 1;
open my $fh, '<', $ino_fdinfo or xbail "open $ino_fdinfo: $!";
my $cmp = [ <$fh> ];
$ino_fdinfo or skip 'Linux/inotify-only removal removal', 1;
open my $fh, '<', $ino_fdinfo or xbail "open $ino_fdinfo: $!";
my $cmp = [ <$fh> ];
- is_deeply($cmp, $ino_contents, 'inotify Maildir watches gone');
+ is_xdeeply($cmp, $ino_contents, 'inotify Maildir watches gone');