Correct logic on passing to handler

This commit is contained in:
lash 2024-10-24 16:17:04 +01:00
parent cab491f0d9
commit e29cb4b5a2
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ func asCustodialRegistrationEvent(gev *geEvent.Event) (*eventCustodialRegistrati
if !ok { if !ok {
return nil, false return nil, false
} }
logg.Debug("parsed ev", "pl", pl, "ev", ev)
return &ev, true return &ev, true
} }

View File

@ -19,7 +19,7 @@ var (
) )
type NatsSubscription struct { type NatsSubscription struct {
*event.Router event.Router
ctx context.Context ctx context.Context
conn *nats.Conn conn *nats.Conn
js jetstream.JetStream js jetstream.JetStream

View File

@ -23,7 +23,7 @@ type Router struct {
func(r *Router) Route(gev *geEvent.Event) error { func(r *Router) Route(gev *geEvent.Event) error {
logg.Debug("have event", "ev", gev) logg.Debug("have event", "ev", gev)
evCC, ok := asCustodialRegistrationEvent(gev) evCC, ok := asCustodialRegistrationEvent(gev)
if !ok { if ok {
return handleCustodialRegistration(evCC) return handleCustodialRegistration(evCC)
} }
return fmt.Errorf("unexpected message") return fmt.Errorf("unexpected message")