Skip to content

Commit f75ee00

Browse files
committed
Refactor DoPing method and update log messages
1 parent 3b8620b commit f75ee00

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

httpclient/httpclient_ping.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"golang.org/x/net/ipv4"
1616
)
1717

18-
// DoPing performs an HTTP "ping" to the specified endpoint using the given HTTP method, body,
18+
// DoPole performs an HTTP "ping" to the specified endpoint using the given HTTP method, body,
1919
// and output variable. It attempts the request until a 200 OK response is received or the
2020
// maximum number of retry attempts is reached. The function uses a backoff strategy for retries
2121
// to manage load on the server and network. This function is useful for checking the availability
@@ -52,9 +52,9 @@ import (
5252
// }
5353
//
5454
// // Process response
55-
func (c *Client) DoPing(method, endpoint string, body, out interface{}) (*http.Response, error) {
55+
func (c *Client) DoPole(method, endpoint string, body, out interface{}) (*http.Response, error) {
5656
log := c.Logger
57-
log.Debug("Starting Ping", zap.String("method", method), zap.String("endpoint", endpoint))
57+
log.Debug("Starting HTTP Ping", zap.String("method", method), zap.String("endpoint", endpoint))
5858

5959
// Initialize retry count and define maximum retries
6060
var retryCount int
@@ -106,7 +106,7 @@ func (c *Client) DoPing(method, endpoint string, body, out interface{}) (*http.R
106106
// // Handle error
107107
// }
108108

109-
func (c *Client) DoPingV2(host string, timeout time.Duration) error {
109+
func (c *Client) DoPing(host string, timeout time.Duration) error {
110110
log := c.Logger
111111

112112
// Listen for ICMP replies

0 commit comments

Comments
 (0)