Skip to content

Commit

Permalink
assign timeout after checking err is nil
Browse files Browse the repository at this point in the history
Signed-off-by: Will Murphy <[email protected]>
  • Loading branch information
willmurphyscode committed Apr 2, 2024
1 parent 09449fa commit 7a21a6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grype/db/curator.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ func NewCurator(cfg Config) (Curator, error) {

fs := afero.NewOsFs()
listingClient, err := defaultHTTPClient(fs, cfg.CACert)
listingClient.Timeout = cfg.ListingFileTimeout
if err != nil {
return Curator{}, err
}
listingClient.Timeout = cfg.ListingFileTimeout

dbClient, err := defaultHTTPClient(fs, cfg.CACert)
dbClient.Timeout = cfg.UpdateTimeout
if err != nil {
return Curator{}, err
}
dbClient.Timeout = cfg.UpdateTimeout

return Curator{
fs: fs,
Expand Down

0 comments on commit 7a21a6d

Please sign in to comment.