]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extindex: rename var: active => active_shards
authorEric Wong <e@80x24.org>
Mon, 11 Oct 2021 08:06:17 +0000 (08:06 +0000)
committerEric Wong <e@80x24.org>
Tue, 12 Oct 2021 03:40:36 +0000 (03:40 +0000)
We also have the idea of active inboxes, too, so "active shards"
ought to make the purpose of the data structure more obvious.

lib/PublicInbox/ExtSearchIdx.pm

index 8da98ba44a9a2d1ad48929ac116559bf6b591a76..64cd8641585d92ef8ce4f7a69ba5ef72a178a56d 100644 (file)
@@ -434,7 +434,7 @@ DELETE FROM over WHERE num > 0 AND num NOT IN (SELECT docid FROM xref3)
 SELECT MIN(num) FROM over WHERE num > 0
 EOM
        $cur // return; # empty
-       my ($r, $n, %active);
+       my ($r, $n, %active_shards);
        $nr = 0;
        while (1) {
                $r = $self->{oidx}->dbh->selectcol_arrayref(<<"", undef, $cur);
@@ -445,15 +445,15 @@ SELECT num FROM over WHERE num >= ? ORDER BY num ASC LIMIT 10000
                        for my $i ($cur..($n - 1)) {
                                my $idx = idx_shard($self, $i);
                                $idx->ipc_do('xdb_remove_quiet', $i);
-                               $active{$idx} = $idx;
+                               $active_shards{$idx} = $idx;
                        }
                        $cur = $n + 1;
                }
                if (checkpoint_due($sync)) {
-                       for my $idx (values %active) {
+                       for my $idx (values %active_shards) {
                                $nr += $idx->ipc_do('nr_quiet_rm')
                        }
-                       %active = ();
+                       %active_shards = ();
                        reindex_checkpoint($self, $sync);
                }
        }