Skip to content

Commit

Permalink
fix: additional failed pointer references
Browse files Browse the repository at this point in the history
  • Loading branch information
ShindouMihou committed Feb 7, 2023
1 parent 7e83461 commit 0a22864
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nachos/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var DefaultQueueGroup *QueueGroup = nil
func Attach(conn *nats.Conn) error {
for path, route := range Routes {
var subscription *nats.Subscription
SubscribeRegularly := func(path string, route *Route) error {
SubscribeRegularly := func(path string, route Route) error {
s, err := conn.Subscribe(path, func(message *nats.Msg) {
Handle(route, message)
})
Expand All @@ -27,19 +27,19 @@ func Attach(conn *nats.Conn) error {
}
if queueGroup.Enabled {
s, err := conn.QueueSubscribe(path, queueGroup.Name, func(message *nats.Msg) {
Handle(&route, message)
Handle(route, message)
})
if err != nil {
return errors.Join(errors.New("failed to subscribe to "+path+": "), err)
}
subscription = s
} else {
if err := SubscribeRegularly(path, &route); err != nil {
if err := SubscribeRegularly(path, route); err != nil {
return err
}
}
} else {
if err := SubscribeRegularly(path, &route); err != nil {
if err := SubscribeRegularly(path, route); err != nil {
return err
}
}
Expand All @@ -48,7 +48,7 @@ func Attach(conn *nats.Conn) error {
return nil
}

func Handle(route *Route, message *nats.Msg) {
func Handle(route Route, message *nats.Msg) {
go func() {
canContinue := true
for _, beforeAction := range route.BeforeAction {
Expand Down

0 comments on commit 0a22864

Please sign in to comment.