From f4ff0a72b1851702a74b61da117b953c0ce9df2d Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 6 Mar 2021 00:09:08 -0700 Subject: [PATCH] clear-all-htmlcache.pl: tidy up and be nice Remove unnecessary counter as counting up by one is the default for a Progress->update call. Also omit the clear as that's automatic on destroy, but do invoke destroy by undef'ing the object. Be nice to avoid interfering with other server activities. Signed-off-by: Kyle J. McKay --- toolbox/clear-all-htmlcache.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolbox/clear-all-htmlcache.pl b/toolbox/clear-all-htmlcache.pl index 8447f03..60114f1 100755 --- a/toolbox/clear-all-htmlcache.pl +++ b/toolbox/clear-all-htmlcache.pl @@ -11,11 +11,11 @@ use Girocco::Config; use Girocco::CLIUtil; use Girocco::Project; +nice_me(18); my $bd = $Girocco::Config::reporoot . '/'; my @projects = Girocco::Project::get_full_list(); my $progress = Girocco::CLIUtil::Progress->new( scalar(@projects), "Clearing htmlcache files"); -my $count = 0; my $cleared = 0; foreach (@projects) { my $hcd = $bd . $_ . ".git/htmlcache"; @@ -24,7 +24,7 @@ foreach (@projects) { closedir $dh; unlink($hcd . "/" . $_) foreach @files; @files and ++$cleared; -} continue {$progress->update(++$count)} -$progress->clear; +} continue {$progress->update} +$progress = undef; print "Projects cleared: $cleared\n"; exit 0 -- 2.11.4.GIT