chore: seed migration objects batch 5
This commit is contained in:
@@ -43,7 +43,6 @@ func (r *RPC) Request(ctx context.Context, msgId string, send func()) (res inter
|
||||
|
||||
defer func() {
|
||||
isClose.Set(true)
|
||||
close(resCh)
|
||||
r.popCallback(msgId)
|
||||
}()
|
||||
|
||||
@@ -57,8 +56,13 @@ func (r *RPC) Request(ctx context.Context, msgId string, send func()) (res inter
|
||||
|
||||
r.task(ctx, send)
|
||||
|
||||
timer := time.NewTimer(time.Second * RPCTimeout)
|
||||
defer timer.Stop()
|
||||
select {
|
||||
case <-time.After(time.Second * RPCTimeout):
|
||||
case <-ctx.Done():
|
||||
err = gerror.Wrap(ctx.Err(), "RPC request canceled")
|
||||
return
|
||||
case <-timer.C:
|
||||
err = gerror.New("RPC response timeout")
|
||||
return
|
||||
case got := <-resCh:
|
||||
|
||||
Reference in New Issue
Block a user