about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index d6fa814c..44afced3 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -284,20 +284,22 @@ sub x_it ($$) {
         dump_and_clear_log();
         if (my $sock = $self->{sock}) {
                 send($sock, "x_it $code", MSG_EOR);
-        } elsif (!$self->{oneshot}) {
-                return; # client disconnected, noop
-        } elsif (my $signum = ($code & 127)) { # usually SIGPIPE (13)
-                $SIG{PIPE} = 'DEFAULT'; # $SIG{$signum} doesn't work
-                kill $signum, $$;
-                sleep; # wait for signal
-        } else {
+        } elsif ($self->{oneshot}) {
                 # don't want to end up using $? from child processes
                 for my $f (qw(lxs l2m)) {
                         my $wq = delete $self->{$f} or next;
                         $wq->DESTROY;
                 }
-                $quit->($code >> 8);
-        }
+                # cleanup anything that has tempfiles
+                delete @$self{qw(ovv dedupe)};
+                if (my $signum = ($code & 127)) { # usually SIGPIPE (13)
+                        $SIG{PIPE} = 'DEFAULT'; # $SIG{$signum} doesn't work
+                        kill $signum, $$;
+                        sleep; # wait for signal
+                } else {
+                        $quit->($code >> 8);
+                }
+        } # else ignore if client disconnected
 }
 
 sub err ($;@) {