feat: 完成鸽达达后台安全与审计改造

This commit is contained in:
richjohnrambo
2026-09-07 11:50:29 +08:00
parent ab2b84c9fa
commit bb87d01644
196 changed files with 19970 additions and 280 deletions
+6 -2
View File
@@ -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: