unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] gcf2: avoid excessive checks for unlinked files
@ 2022-07-20 18:01 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2022-07-20 18:01 UTC (permalink / raw)
  To: meta

We were misusing the timer and not expiring it before checking
for unlinked files.  Now, we check for unlinked files every 60s,
instead.
---
 lib/PublicInbox/Gcf2.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/Gcf2.pm b/lib/PublicInbox/Gcf2.pm
index f546208f..41ee0715 100644
--- a/lib/PublicInbox/Gcf2.pm
+++ b/lib/PublicInbox/Gcf2.pm
@@ -138,10 +138,12 @@ sub loop (;$) {
 		} else { # check expiry to deal with deleted pack files
 			my $now = clock_gettime(CLOCK_MONOTONIC);
 			$check_at //= $now + $exp;
-			if ($now > $check_at && have_unlinked_files()) {
+			if ($now > $check_at) {
 				undef $check_at;
-				$gcf2 = new();
-				%seen = ();
+				if (have_unlinked_files()) {
+					$gcf2 = new();
+					%seen = ();
+				}
 			}
 		}
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-20 18:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20 18:01 [PATCH] gcf2: avoid excessive checks for unlinked files Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).