Fix block indexing

This commit is contained in:
Kirill Fedoseev 2021-06-08 11:23:14 +03:00
parent 8a7a92faa5
commit cf8cb7263d
1 changed files with 2 additions and 1 deletions

View File

@ -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)