Skip to content

Commit

Permalink
Merge pull request #97 from ltybc-coder/rootio-configure-port
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoherty4 authored Mar 13, 2024
2 parents eb6fa85 + 29c0423 commit 3536dca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rootio/storage/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ func RetrieveData() (*Metadata, error) {
if metadataURL == "" {
return nil, errors.New("unable to discover the metadata server from environment variable [MIRROR_HOST]")
}
port, exist := os.LookupEnv("METADATA_SERVICE_PORT")
if !exist {
port = "50061"
}

metadataClient := http.Client{
Timeout: time.Second * 60, // Timeout after 60 seconds (seems massively long is this dial-up?)
}

req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, fmt.Sprintf("http://%s:50061/metadata", metadataURL), nil)
req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, fmt.Sprintf("http://%s:%s/metadata", metadataURL, port), nil)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 3536dca

Please sign in to comment.