about summary refs log tree commit homepage
path: root/lib/PublicInbox/Gcf2.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-07-20 18:01:28 +0000
committerEric Wong <e@80x24.org>2022-07-20 21:14:22 +0000
commit596285b51b02163204fb92877561cd6b935888e8 (patch)
tree0c8c05f1cabd1e6c0b685496448ef22b0187ec55 /lib/PublicInbox/Gcf2.pm
parentf40f4695c0cb576a4e00819da45c1bea8f548aec (diff)
downloadpublic-inbox-596285b51b02163204fb92877561cd6b935888e8.tar.gz
We were misusing the timer and not expiring it before checking
for unlinked files.  Now, we check for unlinked files every 60s,
instead.
Diffstat (limited to 'lib/PublicInbox/Gcf2.pm')
-rw-r--r--lib/PublicInbox/Gcf2.pm8
1 files 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 = ();
+                                }
                         }
                 }
         }