From d2829e99ba46695c780686142afb68c0d432826b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 2 Jan 2019 00:50:53 +0000 Subject: inbox: keep Danga::Socket optional We can't run cleanup stuff without Danga::Socket. --- lib/PublicInbox/Inbox.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 706089ca..73f5761a 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -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; -- cgit v1.2.3-24-ge0c7