Skip to content

Commit

Permalink
Update endpoint name
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Sinha <[email protected]>
  • Loading branch information
NikhilSinha1 committed Feb 19, 2025
1 parent d47593f commit 12c69ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/web/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
)

const (
buildTimingURLPath = "/api/models/build-start"
pushStartURLPath = "/api/models/push-start"
)

var (
ErrorBadResponseNewVersionEndpoint = errors.New("Bad response from new version endpoint")
ErrorBadResponseBuildStartEndpoint = errors.New("Bad response from build start endpoint")
ErrorBadResponsePushStartEndpoint = errors.New("Bad response from push start endpoint")
ErrorBadRegistryURL = errors.New("The image URL must have 3 components in the format of " + global.ReplicateRegistryHost + "/your-username/your-model")
ErrorBadRegistryHost = errors.New("The image name must have the " + global.ReplicateRegistryHost + " prefix when using --x-fast.")
)
Expand Down Expand Up @@ -93,7 +93,7 @@ func (c *Client) PostPushStart(ctx context.Context, cogPushID string, buildTime
}

url := webBaseURL()
url.Path = buildTimingURLPath
url.Path = pushStartURLPath

req, err := http.NewRequestWithContext(ctx, http.MethodPost, url.String(), bytes.NewReader(jsonData))
if err != nil {
Expand All @@ -107,7 +107,7 @@ func (c *Client) PostPushStart(ctx context.Context, cogPushID string, buildTime
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return util.WrapError(ErrorBadResponseBuildStartEndpoint, strconv.Itoa(resp.StatusCode))
return util.WrapError(ErrorBadResponsePushStartEndpoint, strconv.Itoa(resp.StatusCode))
}

return nil
Expand Down

0 comments on commit 12c69ee

Please sign in to comment.