From: Eric Wong Date: Fri, 26 Jul 2024 21:59:24 +0000 (+0000) Subject: watch: more details about full scan start/completion X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5728b3c6e2a832a6bbc13c93b9bad861858199a;p=thirdparty%2Fpublic-inbox.git watch: more details about full scan start/completion Start and stop happens infrequently and may be useful for diagnosing problems about missing messages. A future change will add more details about per-directory scans. Requested-by: Robin H. Johnson --- diff --git a/lib/PublicInbox/Watch.pm b/lib/PublicInbox/Watch.pm index eb90d353f..74cc599c7 100644 --- a/lib/PublicInbox/Watch.pm +++ b/lib/PublicInbox/Watch.pm @@ -620,7 +620,8 @@ sub fs_scan_step { } _done_for_now($self); # do we have more work to do? - PublicInbox::DS::requeue($self) if keys %$opendirs; + keys(%$opendirs) ? PublicInbox::DS::requeue($self) + : warn("# full scan complete\n"); } sub scan { diff --git a/script/public-inbox-watch b/script/public-inbox-watch index 9bcd42edd..64300f095 100755 --- a/script/public-inbox-watch +++ b/script/public-inbox-watch @@ -40,7 +40,8 @@ my $reload = sub { if ($watch) { my $scan = sub { return if !$watch; - warn "# scanning\n"; + my ($s) = @_; + warn "# scanning (full) ", ($s ? "on $s" : 'at startup'), "\n"; $watch->trigger_scan('full'); }; my $quit = sub { # may be called in IMAP/NNTP children diff --git a/t/watch_filter_rubylang.t b/t/watch_filter_rubylang.t index f72feb9f8..81f6b00e1 100644 --- a/t/watch_filter_rubylang.t +++ b/t/watch_filter_rubylang.t @@ -103,7 +103,7 @@ EOM $ibx->{-no_fsync} = 1; is($ibx->search->reopen->mset('b:spam')->size, 0, 'spam removed'); - is_deeply([], \@warn, 'no warnings'); + is_deeply [], [ grep !/^#/, @warn ], 'no warnings'; } done_testing();