Commit ff3f4caf authored by kingwang's avatar kingwang Committed by vipwzw

del retry

parent 1b69df3c
...@@ -3,7 +3,6 @@ package para ...@@ -3,7 +3,6 @@ package para
import ( import (
"context" "context"
"sync/atomic" "sync/atomic"
"time"
"sync" "sync"
...@@ -13,7 +12,6 @@ import ( ...@@ -13,7 +12,6 @@ import (
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
) )
var retry_times = 3
var mlog = log.New("module", "mempool.para") var mlog = log.New("module", "mempool.para")
var topic = "mempool" var topic = "mempool"
...@@ -52,17 +50,11 @@ func (mem *Mempool) SetQueueClient(client queue.Client) { ...@@ -52,17 +50,11 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
case types.EventTx: case types.EventTx:
mlog.Info("Receive msg from para mempool") mlog.Info("Receive msg from para mempool")
tx := msg.GetData().(*types.Transaction) tx := msg.GetData().(*types.Transaction)
for i := 0; i < retry_times; i++ { reply, err := mem.mainGrpcCli.SendTransaction(context.Background(), tx)
reply, err := mem.mainGrpcCli.SendTransaction(context.Background(), tx) if err != nil {
if err == nil { msg.Reply(client.NewMessage(mem.key, types.EventReply, err))
msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: true, Msg: reply.GetMsg()})) } else {
break msg.Reply(client.NewMessage(mem.key, types.EventReply, reply))
} else if err != nil && i != retry_times-1 {
time.Sleep(time.Millisecond * 10)
continue
} else {
msg.Reply(client.NewMessage(mem.key, types.EventReply, err))
}
} }
default: default:
msg.Reply(client.NewMessage(mem.key, types.EventReply, types.ErrActionNotSupport)) msg.Reply(client.NewMessage(mem.key, types.EventReply, types.ErrActionNotSupport))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment