Skip to content

Commit

Permalink
Chore: Skynet SDK version bump
Browse files Browse the repository at this point in the history
Signed-off-by: jay-dee7 <jasdeepsingh.uppal@gmail.com>
  • Loading branch information
jay-dee7 committed Apr 11, 2022
1 parent be1235c commit 36be493
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ require (
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
)


require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/sendgrid/rest v2.6.9+incompatible // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-playground/locales v0.14.0 // indirect
Expand Down Expand Up @@ -53,6 +51,7 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.25.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/sendgrid/rest v2.6.9+incompatible // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -71,4 +70,4 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace github.com/SkynetLabs/go-skynet/v2 => github.com/containerish/go-skynet/v2 v2.0.2-0.20220319175248-c0c090653812
replace github.com/SkynetLabs/go-skynet/v2 => github.com/containerish/go-skynet/v2 v2.0.2-0.20220411175612-3c3d850b3a0c
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/containerish/go-skynet/v2 v2.0.2-0.20220319175248-c0c090653812 h1:GYIStejKwvaHADvrkDpsE3kfgLhTMF9x1iTLvBFGAUg=
github.com/containerish/go-skynet/v2 v2.0.2-0.20220319175248-c0c090653812/go.mod h1:XOk0zwGlXeGjHQgmhXTEk7qTD6FVv3dXPW38Wh3XsIc=
github.com/containerish/go-skynet/v2 v2.0.2-0.20220411175612-3c3d850b3a0c h1:lYT9eGuBaXNIZmJkbgA/HHxkNWu8cPAWT3jKpYTnbXQ=
github.com/containerish/go-skynet/v2 v2.0.2-0.20220411175612-3c3d850b3a0c/go.mod h1:XOk0zwGlXeGjHQgmhXTEk7qTD6FVv3dXPW38Wh3XsIc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
Expand Down
7 changes: 3 additions & 4 deletions skynet/skynet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ func NewClient(oc *config.OpenRegistryConfig) *Client {
CustomUserAgent: oc.SkynetConfig.CustomUserAgent,
APIKey: oc.SkynetConfig.ApiKey,
CustomCookie: oc.SkynetConfig.ApiKey,
HttpClient: newHttpClientForSkynet(),
}

color.Green("Skynet Portal: %s", oc.SkynetConfig.SkynetPortalURL)
skynetClient := skynet.NewCustom(oc.SkynetConfig.SkynetPortalURL, opts)
httpClient := NewHttpClientForSkynet()

return &Client{
skynet: &skynetClient,
httpClient: httpClient,
isRemote: false,
host: oc.Registry.Host,
gatewayURL: oc.SkynetConfig.SkynetPortalURL,
Expand Down Expand Up @@ -111,7 +110,7 @@ func (c *Client) Metadata(skylink string) (*skynet.Metadata, error) {
err = fmt.Errorf("SKYNET_METADATA_ERR: %w", err)
retryCounter--
// cool off
time.Sleep(time.Second * 2)
time.Sleep(time.Second * 3)
continue
}
break
Expand All @@ -120,7 +119,7 @@ func (c *Client) Metadata(skylink string) (*skynet.Metadata, error) {
return metadata, err
}

func NewHttpClientForSkynet() *http.Client {
func newHttpClientForSkynet() *http.Client {
t := http.DefaultTransport.(*http.Transport).Clone()
t.MaxIdleConns = 100
t.MaxConnsPerHost = 100
Expand Down
4 changes: 1 addition & 3 deletions skynet/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"io"
"net/http"

skynet "github.com/SkynetLabs/go-skynet/v2"
"github.com/containerish/OpenRegistry/config"
Expand All @@ -13,11 +12,10 @@ import (
type (
Client struct {
skynet *skynet.SkynetClient
httpClient *http.Client
config *config.OpenRegistryConfig
host string
gatewayURL string
isRemote bool
config *config.OpenRegistryConfig
}
Config struct {
Host string
Expand Down

0 comments on commit 36be493

Please sign in to comment.