From cf8cb7263daffae323acbfd3b0fa48ec3d485d5d Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Tue, 8 Jun 2021 11:23:14 +0300 Subject: [PATCH] Fix block indexing --- monitor/services.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor/services.go b/monitor/services.go index 6bb93b3..23e0dcf 100644 --- a/monitor/services.go +++ b/monitor/services.go @@ -234,9 +234,10 @@ func StartBlockIndexer(ctx context.Context, conn *db.DB, clients map[string]*eth continue } rows.Close() + wg.Wait() if batch.Len() > 0 { - wg.Wait() + logger.Printf("found %d blocks without timestamps\n", batch.Len()) err = conn.SendBatch(context.Background(), &batch).Close() if err != nil { logger.Println(err)