Skip to content

Commit

Permalink
fix: log create agent pool db errors
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Oct 29, 2024
1 parent 45f115e commit ece6de7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions internal/agent/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,20 @@ func (s *Service) CreateAgentPool(ctx context.Context, opts CreateAgentPoolOptio
if err != nil {
return nil, err
}
pool, err := newPool(opts)
pool, err := func() (*Pool, error) {
pool, err := newPool(opts)
if err != nil {
return nil, err
}
if err := s.db.createPool(ctx, pool); err != nil {
return nil, err
}
return pool, nil
}()
if err != nil {
s.Error(err, "creating agent pool", "subject", subject)
return nil, err
}
if err := s.db.createPool(ctx, pool); err != nil {
return nil, err
}
s.V(0).Info("created agent pool", "subject", subject, "pool", pool)
return pool, nil
}
Expand Down

0 comments on commit ece6de7

Please sign in to comment.