From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,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.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BDD4F1F406 for ; Wed, 22 Nov 2023 21:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1700688251; bh=WO4Zm4ELot3KYSpW6z7YwgjreJoXF6UkhUqy9RWIxns=; h=From:To:Subject:Date:From; b=U6dtTrIQLGol1YSupZtMKuj/ECYckLQX2jUfKYtxOnsDwRcKyerWtzOLU/O3S2Wmp IZ3MRYkAJ8VbMM6WUgVDihnOGR+MdhSImyhanhhz46TVEFWb4r/1RAUZNfBKFgwjom 6V+G+gRU+SvWQRFK0OEggMmCnSfZ0KJFTf9p7lsU= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei_saved_search: don't create Git object during ->DESTROY Date: Wed, 22 Nov 2023 21:24:11 +0000 Message-ID: <20231122212411.3829382-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This fixes t/lei-q-save.t getting stuck since $self->{ale} is already gone by the time DESTROY gets called. --- lib/PublicInbox/LeiSavedSearch.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm index 2811c46d..9ae9dcdb 100644 --- a/lib/PublicInbox/LeiSavedSearch.pm +++ b/lib/PublicInbox/LeiSavedSearch.pm @@ -245,10 +245,10 @@ sub git { $_[0]->{git} //= PublicInbox::Git->new($_[0]->{ale}->git->{git_dir}) } sub pause_dedupe { my ($self) = @_; - git($self)->cleanup; - my $lockfh = delete $self->{lockfh}; # from lock_for_scope_fast; - my $oidx = delete($self->{oidx}) // return; - $oidx->commit_lazy; + my ($git, $oidx) = delete @$self{qw(git oidx)}; + $git->cleanup if $git; + $oidx->commit_lazy if $oidx; + delete $self->{lockfh}; # from lock_for_scope_fast; } sub reset_dedupe {