about summary refs log tree commit homepage
path: root/lib/PublicInbox/Emergency.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 20:17:20 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 20:17:49 +0000
commit34bc77692cb57a13dda5b8e7ea1c43fbccfec0af (patch)
treeb49394d5a6dcc1bc6f43d1c56fbe660ffb815135 /lib/PublicInbox/Emergency.pm
parente5c2e2588d7ad2243afeabad67b3c951c5b66643 (diff)
downloadpublic-inbox-34bc77692cb57a13dda5b8e7ea1c43fbccfec0af.tar.gz
I mainly focus on -watch for mirroring busy mailing lists, but
using -mda should remain an option.
Diffstat (limited to 'lib/PublicInbox/Emergency.pm')
-rw-r--r--lib/PublicInbox/Emergency.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Emergency.pm b/lib/PublicInbox/Emergency.pm
index 231b4197..66adc631 100644
--- a/lib/PublicInbox/Emergency.pm
+++ b/lib/PublicInbox/Emergency.pm
@@ -18,7 +18,7 @@ sub new {
                 next if -d $d;
                 -d $d or mkdir($d) or die "failed to mkdir($d): $!\n";
         }
-        bless { dir => $dir, files => {}, t => 0, cnt => 0 }, $class;
+        bless { dir => $dir, files => {}, t => 0, cnt => 0, pid => $$ }, $class;
 }
 
 sub _fn_in {
@@ -75,6 +75,7 @@ sub fh {
 
 sub commit {
         my ($self) = @_;
+        $$ == $self->{pid} or return; # no-op in forked child
 
         delete $self->{fh};
         my $tmp = delete $self->{tmp} or return;