mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
Execute wrappers before router
This commit is contained in:
@ -70,11 +70,9 @@ type router struct {
|
||||
hdlrWrappers []HandlerWrapper
|
||||
}
|
||||
|
||||
func newRpcRouter(opts Options) *router {
|
||||
func newRpcRouter() *router {
|
||||
return &router{
|
||||
name: opts.Name,
|
||||
hdlrWrappers: opts.HdlrWrappers,
|
||||
serviceMap: make(map[string]*service),
|
||||
serviceMap: make(map[string]*service),
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,10 +205,6 @@ func (s *service) call(ctx context.Context, router *router, sending *sync.Mutex,
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := len(router.hdlrWrappers); i > 0; i-- {
|
||||
fn = router.hdlrWrappers[i-1](fn)
|
||||
}
|
||||
|
||||
errmsg := ""
|
||||
err := fn(ctx, r, replyv.Interface())
|
||||
if err != nil {
|
||||
@ -252,10 +246,6 @@ func (s *service) call(ctx context.Context, router *router, sending *sync.Mutex,
|
||||
}
|
||||
}
|
||||
|
||||
for i := len(router.hdlrWrappers); i > 0; i-- {
|
||||
fn = router.hdlrWrappers[i-1](fn)
|
||||
}
|
||||
|
||||
// client.Stream request
|
||||
r.stream = true
|
||||
|
||||
|
Reference in New Issue
Block a user