From 7497b1c69789f04bf94037b2b34bc4486c974534 Mon Sep 17 00:00:00 2001 From: lgh <913337456@qq.com> Date: Wed, 20 Oct 2021 01:18:32 +0800 Subject: [PATCH] add runtime.Gosched() to store method --- cmd/main.go | 1 - parser/handler/common.go | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index 2f1f023..4303648 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -159,7 +159,6 @@ func runServer(ctx *cli.Context) error { } } } - runtime.Gosched() time.Sleep(time.Second) } }() diff --git a/parser/handler/common.go b/parser/handler/common.go index c8a3911..c3c56b3 100644 --- a/parser/handler/common.go +++ b/parser/handler/common.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/DeAccountSystems/das_commonlib/common/rocksdb" "github.com/tecbot/gorocksdb" + "runtime" ) /** @@ -165,6 +166,7 @@ func storeAccountInfoToRocksDb(db *gorocksdb.DB, writeBatch *gorocksdb.WriteBatc log.Info(fmt.Sprintf( "storeAccountInfoToRocksDb, add new item, account: %s, id: %s, owner: %s", item.AccountData.Account, item.AccountData.AccountIdHex, item.AccountData.OwnerLockArgsHex)) + runtime.Gosched() putsItem(ownerLockArgsHexKey, &item, &newList) } }