internal/postgres: initialize excluded state
Load the excluded table as soon as we create a DB, to
initialize in the in-memory state.
Change-Id: I1546566a1cf7c842b101ff8537f0433c8d170e32
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/262417
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/internal/postgres/postgres.go b/internal/postgres/postgres.go
index 78ab5f1..596067a 100644
--- a/internal/postgres/postgres.go
+++ b/internal/postgres/postgres.go
@@ -44,6 +44,7 @@
log.Errorf(context.Background(), "getting excluded prefixes: %v", err)
})
ctx, cancel := context.WithCancel(context.Background())
+ p.Poll(ctx) // Initialize the state.
p.Start(ctx, time.Minute)
return &DB{
db: db,