From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 511031F54E for ; Mon, 12 Sep 2022 16:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662998688; bh=yqlmCULG53jLs2DMY5Wr+dYmSxPLAIa3QPxIHkfZA3A=; h=From:To:Subject:Date:From; b=JUd9KPc+ge/uMpY/ac+srYeX7xdO26y7E2FQn1lliL9BAaUK41Aafc0EkErg3a8+J BXVr2duSJXzyUo+1QmC0Kmox51MaZVjLSsb9pQxJRsF6qQmr0JcQzFyazLvPPum8Q+ eVQRQTt+puIcAMV6YqLt5CtC64sKJ4G5kejsz9O0= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] git_async_cat: don't use Gcf2 for temporary git dirs Date: Mon, 12 Sep 2022 16:04:48 +0000 Message-Id: <20220912160448.3048240-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We don't want to be holding references to temporary directories longer than necessary, an Gcf is intended to be long-lived. --- lib/PublicInbox/GitAsyncCat.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/GitAsyncCat.pm b/lib/PublicInbox/GitAsyncCat.pm index c12c4ec2..b32c2fd3 100644 --- a/lib/PublicInbox/GitAsyncCat.pm +++ b/lib/PublicInbox/GitAsyncCat.pm @@ -51,7 +51,8 @@ sub ibx_async_cat ($$$$) { # {topdir} means ExtSearch (likely [extindex "all"]) with potentially # 100K alternates. git(1) has a proposed patch for 100K alternates: # - if (!defined($ibx->{topdir}) && ($GCF2C //= eval { + if (!defined($ibx->{topdir}) && !defined($git->{-tmp}) && + ($GCF2C //= eval { require PublicInbox::Gcf2Client; PublicInbox::Gcf2Client::new(); } // 0)) { # 0: do not retry if libgit2 or Inline::C are missing