From: Eric Wong Date: Wed, 14 Aug 2024 00:16:41 +0000 (+0000) Subject: git: rename `_active' sub to `cat_active' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b49bf4629471d8cb30c00a28d1c3b13aea304e67;p=thirdparty%2Fpublic-inbox.git git: rename `_active' sub to `cat_active' Having an underscore prefix is confusing for a public subroutine, and the `cat_' prefix makes it obvious it isn't some other command. --- diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 32c11a593..dd0a14e91 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -457,7 +457,7 @@ sub date_parse { } $self->qx('rev-parse', map { "--since=$_" } @_); } -sub _active ($) { +sub cat_active ($) { scalar(@{gcf_inflight($_[0]) // []}) || ($_[0]->{ck} && scalar(@{gcf_inflight($_[0]->{ck}) // []})) } @@ -466,7 +466,7 @@ sub _active ($) { # both completely done by using this: sub async_wait_all ($) { my ($self) = @_; - while (_active($self)) { + while (cat_active($self)) { check_async_wait($self); cat_async_wait($self); } @@ -475,7 +475,7 @@ sub async_wait_all ($) { # returns true if there are pending "git cat-file" processes sub cleanup { my ($self, $lazy) = @_; - ($lazy && _active($self)) and + ($lazy && cat_active($self)) and return $self->{epwatch} ? watch_async($self) : 1; local $in_cleanup = 1; async_wait_all($self); diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index b2da2bc36..f9e8267bb 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -573,7 +573,7 @@ sub set_xvmd { sub check_done { my ($self) = @_; - $self->git->_active ? + $self->git->cat_active ? add_uniq_timer("$self-check_done", 5, \&check_done, $self) : done($self); }