mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-05-07 10:05:54 +00:00
pull all non-request scoped values out of context
This commit is contained in:
@@ -20,14 +20,12 @@ type RouterInput struct {
|
||||
func (ro *RouterInput) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
||||
|
||||
payload := wrappedPayload.Payload
|
||||
router, ok := ctx.Value(common.RouterContextKey).(common.RouteIO)
|
||||
if !ok {
|
||||
|
||||
if wrappedPayload.Router == nil {
|
||||
wrappedPayload.End = true
|
||||
return wrappedPayload, errors.New("router.input no router found")
|
||||
}
|
||||
|
||||
_, err := router.HandleInput(ctx, ro.SourceId, payload)
|
||||
_, err := wrappedPayload.Router.HandleInput(ctx, ro.SourceId, payload)
|
||||
|
||||
if err != nil {
|
||||
wrappedPayload.End = true
|
||||
|
||||
Reference in New Issue
Block a user