diff options
author | jloup <jean-loup.jamet@trainline.com> | 2018-06-21 09:32:48 +0200 |
---|---|---|
committer | jloup <jean-loup.jamet@trainline.com> | 2018-06-21 09:33:10 +0200 |
commit | c086df915bf9884fe514a00b6c6d04f36321e1e3 (patch) | |
tree | 874017c71c0c7801cf9b42192cefbe0dd316dacf /api/market_config.go | |
parent | f7521f251456fea091d1eb950fd55a7cd4257c65 (diff) | |
download | Front-c086df915bf9884fe514a00b6c6d04f36321e1e3.tar.gz Front-c086df915bf9884fe514a00b6c6d04f36321e1e3.tar.zst Front-c086df915bf9884fe514a00b6c6d04f36321e1e3.zip |
Set poloniex client timeout to 20 seconds.v0.0.21
Diffstat (limited to 'api/market_config.go')
-rw-r--r-- | api/market_config.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/market_config.go b/api/market_config.go index c7e2e15..155da1a 100644 --- a/api/market_config.go +++ b/api/market_config.go | |||
@@ -80,7 +80,7 @@ func (q TestMarketCredentialsQuery) Run() (interface{}, *Error) { | |||
80 | } | 80 | } |
81 | 81 | ||
82 | resultErr := CallExternalService(fmt.Sprintf("'%s' TestCredentials", q.In.Market), EXTERNAL_SERVICE_TIMEOUT_SECONDS*time.Second, func() error { | 82 | resultErr := CallExternalService(fmt.Sprintf("'%s' TestCredentials", q.In.Market), EXTERNAL_SERVICE_TIMEOUT_SECONDS*time.Second, func() error { |
83 | err := Poloniex.TestCredentials(config.Config["key"], config.Config["secret"]) | 83 | err := Poloniex.TestCredentials(config.Config["key"], config.Config["secret"], EXTERNAL_SERVICE_TIMEOUT_SECONDS) |
84 | 84 | ||
85 | if utils.ErrIs(err, markets.InvalidCredentials) { | 85 | if utils.ErrIs(err, markets.InvalidCredentials) { |
86 | return &Error{InvalidMarketCredentials, "wrong market credentials", fmt.Errorf("wrong '%v' market credentials", q.In.Market)} | 86 | return &Error{InvalidMarketCredentials, "wrong market credentials", fmt.Errorf("wrong '%v' market credentials", q.In.Market)} |
@@ -152,7 +152,7 @@ func (q UpdateMarketConfigQuery) Run() (interface{}, *Error) { | |||
152 | } | 152 | } |
153 | 153 | ||
154 | resultErr := CallExternalService(fmt.Sprintf("'%s' TestCredentials", q.In.Market), EXTERNAL_SERVICE_TIMEOUT_SECONDS*time.Second, func() error { | 154 | resultErr := CallExternalService(fmt.Sprintf("'%s' TestCredentials", q.In.Market), EXTERNAL_SERVICE_TIMEOUT_SECONDS*time.Second, func() error { |
155 | err := Poloniex.TestCredentials(marketConfig.Config["key"], marketConfig.Config["secret"]) | 155 | err := Poloniex.TestCredentials(marketConfig.Config["key"], marketConfig.Config["secret"], EXTERNAL_SERVICE_TIMEOUT_SECONDS) |
156 | 156 | ||
157 | if utils.ErrIs(err, markets.InvalidCredentials) { | 157 | if utils.ErrIs(err, markets.InvalidCredentials) { |
158 | return &Error{InvalidMarketCredentials, "wrong market credentials", fmt.Errorf("wrong '%v' market credentials", q.In.Market)} | 158 | return &Error{InvalidMarketCredentials, "wrong market credentials", fmt.Errorf("wrong '%v' market credentials", q.In.Market)} |