]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
lei: drop workers on EOF from clients
[public-inbox.git] / lib / PublicInbox / LEI.pm
index 50a7fdadfc7491058fca0f60f1a8a074cfaa28cf..a9f5edaebe4efad8cac852874a7adaba31208c66 100644 (file)
@@ -323,6 +323,7 @@ my %OPTDESC = (
 'path-a|a=s' => 'pre-image pathname associated with OID',
 'path-b|b=s' => 'post-image pathname associated with OID',
 'git-dir=s@' => 'additional git repository to scan',
+'dir=s inspect' => 'specify a inboxdir, extindex topdir or Xapian shard',
 'proxy=s' => [ 'PROTO://HOST[:PORT]', # shared with curl(1)
        "proxy for (e.g. `socks5h://0:9050')" ],
 'torsocks=s' => ['VAL|auto|no|yes',
@@ -353,6 +354,7 @@ my %OPTDESC = (
        "or\xa0`-'\x{a0}for\x{a0}stdout)" ],
 'mua=s' => [ 'CMD',
        "MUA to run on --output Maildir or mbox (e.g.\xa0`mutt\xa0-f\xa0%f')" ],
+'new-only      import' => 'only import new messages from IMAP source',
 
 'inbox-version=i' => [ 'NUM|1|2',
                'force a public-inbox version with --mirror'],
@@ -761,11 +763,7 @@ sub dispatch {
                                next if $d eq ''; # same as git(1)
                                chdir $d or return fail($self, "cd $d: $!");
                        }
-                       if (delete $self->{3}) { # update cwd for rel2abs
-                               opendir my $dh, '.' or
-                                       return fail($self, "opendir . $!");
-                               $self->{3} = $dh;
-                       }
+                       open $self->{3}, '.' or return fail($self, "open . $!");
                }
                $cb->($self, @argv);
        } elsif (grep(/\A-/, $cmd, @argv)) { # --help or -h only
@@ -1097,6 +1095,7 @@ sub event_step {
                        }
                        die "unrecognized client signal: $buf";
                }
+               _drop_wq($self); # EOF, client disconnected
                dclose($self);
        };
        if (my $err = $@) {