]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inbox: keep Danga::Socket optional
authorEric Wong <e@80x24.org>
Wed, 2 Jan 2019 00:50:53 +0000 (00:50 +0000)
committerEric Wong <e@80x24.org>
Wed, 2 Jan 2019 00:53:01 +0000 (00:53 +0000)
We can't run cleanup stuff without Danga::Socket.

lib/PublicInbox/Inbox.pm

index 706089caac1b5788edb386c7dbf3a17d7f9b9f80..73f5761a875b1d1e6b8f6bfa3512248f6db54b5f 100644 (file)
@@ -17,6 +17,7 @@ eval {
        require PublicInbox::EvCleanup;
        $cleanup_timer = undef; # OK if we get here
 };
+my $cleanup_broken = $@;
 
 my $CLEANUP = {}; # string(inbox) -> inbox
 sub cleanup_task () {
@@ -31,6 +32,7 @@ sub cleanup_task () {
 
 sub _cleanup_later ($) {
        my ($self) = @_;
+       return if $cleanup_broken;
        return unless PublicInbox::EvCleanup::enabled();
        $cleanup_timer ||= PublicInbox::EvCleanup::later(*cleanup_task);
        $CLEANUP->{"$self"} = $self;