Skip to content

Commit

Permalink
fixed nil pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
spikelu2016 committed Mar 15, 2024
1 parent 24f07e0 commit d0d6c81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.13.1 - 2024-03-15
### Fixed
- Fixed `nil` pointer error

## 1.13.0 - 2024-03-14
### Added
- Added `policy` APIs
Expand Down
2 changes: 1 addition & 1 deletion cmd/bricksllm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func main() {
eventConsumer := message.NewConsumer(eventMessageChan, log, 4, handler.HandleEventWithRequestAndResponse)
eventConsumer.StartEventMessageConsumers()

detector, err := amazon.NewClient(cfg.AmazonRequestTimeout, cfg.AmazonConnectionTimeout)
detector, err := amazon.NewClient(cfg.AmazonRequestTimeout, cfg.AmazonConnectionTimeout, log)
if err != nil {
log.Sugar().Infof("error when connecting to amazon: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion internal/pii/amazon/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Client struct {
log *zap.Logger
}

func NewClient(rt time.Duration, ct time.Duration) (*Client, error) {
func NewClient(rt time.Duration, ct time.Duration, log *zap.Logger) (*Client, error) {
ctx, cancel := context.WithTimeout(context.Background(), ct)
defer cancel()

Expand All @@ -35,6 +35,7 @@ func NewClient(rt time.Duration, ct time.Duration) (*Client, error) {
client: client,
rt: rt,
ct: ct,
log: log,
}, nil
}

Expand Down

0 comments on commit d0d6c81

Please sign in to comment.