From 782f14750202ba8228bca67c9dfa4623de29f809 Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Mon, 9 Sep 2024 18:16:12 +0200 Subject: [PATCH] defer ReindexBlocks --- vochain/indexer/indexer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vochain/indexer/indexer.go b/vochain/indexer/indexer.go index 16f208ec3..392dd579a 100644 --- a/vochain/indexer/indexer.go +++ b/vochain/indexer/indexer.go @@ -176,7 +176,7 @@ func (idx *Indexer) startDB() error { if gooseMigrationsPending(idx.readWriteDB, "migrations") { log.Info("indexer db needs migration, scheduling a reindex after sync") - go idx.ReindexBlocks(false) + defer func() { go idx.ReindexBlocks(false) }() } if err := goose.Up(idx.readWriteDB, "migrations"); err != nil {