Skip to content

Commit

Permalink
fix: attempt to fix app config nats issue
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Trost <[email protected]>
  • Loading branch information
galexrt committed Oct 9, 2024
1 parent c2ef62a commit 9a071bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/config/appconfig/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
UpdateSubject events.Type = "update"
)

func (c *Config) registerSubscriptions(ctx context.Context) error {
func (c *Config) registerSubscriptions(ctx context.Context, bc context.Context) error {
cfg := jetstream.StreamConfig{
Name: "APPCONFIG",
Description: "AppConfig update events",
Expand Down Expand Up @@ -46,10 +46,10 @@ func (c *Config) registerSubscriptions(ctx context.Context) error {
c.jsCons = nil
}

c.jsCons, err = consumer.Consume(c.handleMessageFunc(ctx),
c.jsCons, err = consumer.Consume(c.handleMessageFunc(bc),
c.js.ConsumeErrHandlerWithRestart(context.Background(), c.logger,
func(_ context.Context, ctx context.Context) error {
return c.registerSubscriptions(ctx)
return c.registerSubscriptions(bc, bc)
}))
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/appconfig/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func New(p Params) (IConfig, error) {
return err
}

return cfg.registerSubscriptions(c)
return cfg.registerSubscriptions(c, ctx)
}))

p.LC.Append(fx.StopHook(func(ctx context.Context) error {
Expand Down

0 comments on commit 9a071bd

Please sign in to comment.