about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 7c1c3afe..724df50a 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -13,6 +13,10 @@ use Carp qw(croak);
 # returns true if further checking is required
 sub cleanup_shards { $_[0]->{search} ? $_[0]->{search}->cleanup_shards : undef }
 
+sub check_inodes ($) {
+        for (qw(over mm)) { $_[0]->{$_}->check_inodes if $_[0]->{$_} }
+}
+
 sub do_cleanup {
         my ($ibx) = @_;
         my $live;
@@ -21,11 +25,16 @@ sub do_cleanup {
                                         : $ibx->{git}->cleanup_if_unlinked;
                 delete($ibx->{git}) unless $live;
         }
+        if ($live) {
+                check_inodes($ibx);
+        } else {
+                delete(@$ibx{qw(over mm description cloneurl
+                                -imap_url -nntp_url)});
+        }
         $ibx->cleanup_shards and $live = 1;
         for my $git (@{$ibx->{-repo_objs} // []}) {
                 $live = 1 if $git->cleanup(1);
         }
-        delete(@$ibx{qw(over mm description cloneurl -imap_url -nntp_url)});
         PublicInbox::DS::add_uniq_timer($ibx+0, 5, \&do_cleanup, $ibx) if $live;
 }
 
@@ -362,13 +371,6 @@ sub unsubscribe_unlock {
         delete $self->{unlock_subs}->{$ident};
 }
 
-sub check_inodes ($) {
-        my ($self) = @_;
-        for (qw(over mm)) {
-                $self->{$_}->check_inodes if $self->{$_};
-        }
-}
-
 # called by inotify
 sub on_unlock {
         my ($self) = @_;