Skip to content

Commit

Permalink
licenseKey call timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
chaudharysaket committed Apr 12, 2024
1 parent 8200a25 commit 5fb5cdd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func main() {
}

// Attempt to find the license key for telemetry sending
licenseKey, err := credentials.GetNewRelicLicenseKey(ctx, conf)
var timeout = 5 * time.Second
ctxLicenseKey, cancel := context.WithTimeout(ctx, timeout)
defer cancel()
licenseKey, err := credentials.GetNewRelicLicenseKey(ctxLicenseKey, conf)
if err != nil {
util.Logln("Failed to retrieve New Relic license key", err)
// We fail open; telemetry will go to CloudWatch instead
Expand Down

0 comments on commit 5fb5cdd

Please sign in to comment.