From 5532093d588f74bcf6230f38783996f53c3f4fca Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Mon, 27 Jan 2020 12:59:07 -0800 Subject: [PATCH] Commit only once Signed-off-by: Jakub Sztandera --- cmd/lotus-chainwatch/storage.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cmd/lotus-chainwatch/storage.go b/cmd/lotus-chainwatch/storage.go index dadd5e32d..caf0b3765 100644 --- a/cmd/lotus-chainwatch/storage.go +++ b/cmd/lotus-chainwatch/storage.go @@ -588,12 +588,6 @@ create temp table b (like blocks excluding constraints) on commit drop; return xerrors.Errorf("blk put: %w", err) } - err = tx.Commit() - - if err != nil { - return xerrors.Errorf("commit: %w", err) - } - stmt3, err := tx.Prepare(`copy c(block, index, sector_id, parital) from stdin`) if err != nil { return xerrors.Errorf("s3 create: %w") @@ -620,7 +614,6 @@ create temp table b (like blocks excluding constraints) on commit drop; } err = tx.Commit() - if err != nil { return xerrors.Errorf("commit: %w", err) }