Correct logic on passing to handler
This commit is contained in:
		
							parent
							
								
									cab491f0d9
								
							
						
					
					
						commit
						e29cb4b5a2
					
				@ -23,6 +23,7 @@ func asCustodialRegistrationEvent(gev *geEvent.Event) (*eventCustodialRegistrati
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return nil, false
 | 
			
		||||
	}
 | 
			
		||||
	logg.Debug("parsed ev", "pl", pl, "ev", ev)
 | 
			
		||||
	return &ev, true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,7 @@ var (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type NatsSubscription struct {
 | 
			
		||||
	*event.Router
 | 
			
		||||
	event.Router
 | 
			
		||||
	ctx context.Context
 | 
			
		||||
	conn *nats.Conn
 | 
			
		||||
	js jetstream.JetStream
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@ type Router struct {
 | 
			
		||||
func(r *Router) Route(gev *geEvent.Event) error {
 | 
			
		||||
	logg.Debug("have event", "ev", gev)
 | 
			
		||||
	evCC, ok := asCustodialRegistrationEvent(gev)
 | 
			
		||||
	if !ok {
 | 
			
		||||
	if ok {
 | 
			
		||||
		return handleCustodialRegistration(evCC)
 | 
			
		||||
	}
 | 
			
		||||
	return fmt.Errorf("unexpected message")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user