diff options
author | Eric Wong <e@80x24.org> | 2017-01-18 19:13:09 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-01-19 02:11:31 +0000 |
commit | c265481528208a832c5731b8da597554f2a8f693 (patch) | |
tree | 9c48cc5da2161845326b4d8eeb49c2b666ce897c /lib/PublicInbox | |
parent | 24d417a8943d6ddac8f903731918c97d0f034c5b (diff) | |
download | public-inbox-c265481528208a832c5731b8da597554f2a8f693.tar.gz |
We don't want to be triggering OOM or swapping on weaker systems when we have dozens of inboxes as potential targets.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/WatchMaildir.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/PublicInbox/WatchMaildir.pm b/lib/PublicInbox/WatchMaildir.pm index d08f2297..0b284bdb 100644 --- a/lib/PublicInbox/WatchMaildir.pm +++ b/lib/PublicInbox/WatchMaildir.pm @@ -224,7 +224,14 @@ sub _importer_for { my $addr = $inbox->{-primary_address}; PublicInbox::Import->new($git, $name, $addr, $inbox); }; - $self->{importers}->{"$im"} = $im; + + my $importers = $self->{importers}; + if (scalar(keys(%$importers)) > 2) { + delete $importers->{"$im"}; + _done_for_now($self); + } + + $importers->{"$im"} = $im; } sub _scrubber_for { |