Skip to content

Commit

Permalink
Use ParseInt instead of Atoi when converting process id string to an …
Browse files Browse the repository at this point in the history
…int (#384)
  • Loading branch information
dhurley authored Jul 10, 2023
1 parent 02f86ca commit 171563b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/metrics/sources/nginx_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (client *NginxWorkerClient) GetWorkerStats(childProcs []*proto.NginxDetails
}
numWorkers++

pidAsInt, err := strconv.Atoi(nginxDetails.ProcessId)
pidAsInt, err := strconv.ParseInt(nginxDetails.ProcessId, 10, 32)
if err != nil {
client.logger.Log(fmt.Sprintf("Failed to convert %s to int: %v", nginxDetails.ProcessId, err))
continue
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 171563b

Please sign in to comment.