We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I init in a injector method ensure grpc client init one time,such as: `func InitTronGRpc() (*client.GrpcClient, func(), error) { cfg := config.C.TronGrid opts := make([]grpc.DialOption, 0) opts = append(opts, grpc.WithInsecure())
conn := client.NewGrpcClient(cfg.RPCHost) if err := conn.Start(opts...); err != nil { _ = fmt.Errorf("Error connecting GRPC Client: %v \n", err) } cleanFunc := func() { conn.Stop() } err := conn.SetAPIKey(cfg.ApiGrpcKey) if err != nil { logger.Errorf(context.Background(), "init GRPC Client error %v ", err) _ = fmt.Errorf("ini GRPC Client err: %v \n", err) return nil, cleanFunc, err } _, err = account.ImportFromPrivateKey( cfg.OperatorPrivateKey, cfg.OperatorName, cfg.OperatorPassword) if err != nil { logger.Errorf(context.Background(), "import private key error %v ", err) _ = fmt.Errorf("import private key err: %v \n", err) } return conn, cleanFunc, nil
} `
and I call UnlockedKeystore in a service , I found UnlockedKeystore not release watcher goroutine, cause memory is full
UnlockedKeystore
func (tron *TronOperator) SignatureExecuteTx(ctx context.Context, tx *api.TransactionExtention, err error) (string, error) { ks, acct, _ := store.UnlockedKeystore(config.C.TronGrid.OperatorAddress, config.C.TronGrid.OperatorPassword) ctrlr := transaction.NewController(tron.TronGrpc, ks, acct, tx.Transaction) if err = ctrlr.ExecuteTransaction(); err != nil { return "", err } txId := utils.BytesToNo0xHexString(tx.GetTxid()) return txId, err }
all goroutine keep in memory, like this
How to solve ? Thanks!
The text was updated successfully, but these errors were encountered:
did u solve problem
Sorry, something went wrong.
No branches or pull requests
I init in a injector method ensure grpc client init one time,such as:
`func InitTronGRpc() (*client.GrpcClient, func(), error) {
cfg := config.C.TronGrid
opts := make([]grpc.DialOption, 0)
opts = append(opts, grpc.WithInsecure())
}
`
and I call UnlockedKeystore in a service ,
I found
UnlockedKeystore
not release watcher goroutine, cause memory is fullfunc (tron *TronOperator) SignatureExecuteTx(ctx context.Context, tx *api.TransactionExtention, err error) (string, error) { ks, acct, _ := store.UnlockedKeystore(config.C.TronGrid.OperatorAddress, config.C.TronGrid.OperatorPassword) ctrlr := transaction.NewController(tron.TronGrpc, ks, acct, tx.Transaction) if err = ctrlr.ExecuteTransaction(); err != nil { return "", err } txId := utils.BytesToNo0xHexString(tx.GetTxid()) return txId, err }
all goroutine keep in memory, like this
How to solve ?
Thanks!
The text was updated successfully, but these errors were encountered: