}
resultErr := CallExternalService(fmt.Sprintf("'%s' TestCredentials", q.In.Market), EXTERNAL_SERVICE_TIMEOUT_SECONDS*time.Second, func() error {
- err := Poloniex.TestCredentials(config.Config["key"], config.Config["secret"])
+ err := Poloniex.TestCredentials(config.Config["key"], config.Config["secret"], EXTERNAL_SERVICE_TIMEOUT_SECONDS)
if utils.ErrIs(err, markets.InvalidCredentials) {
return &Error{InvalidMarketCredentials, "wrong market credentials", fmt.Errorf("wrong '%v' market credentials", q.In.Market)}
return nil, NewInternalError(resultErr)
} else if resultErr != nil {
return nil, NewInternalError(resultErr)
+ } else if resultErr == nil {
+ newStatus = db.MarketConfigEnabled
}
if newStatus != config.Status {
}
resultErr := CallExternalService(fmt.Sprintf("'%s' TestCredentials", q.In.Market), EXTERNAL_SERVICE_TIMEOUT_SECONDS*time.Second, func() error {
- err := Poloniex.TestCredentials(marketConfig.Config["key"], marketConfig.Config["secret"])
+ err := Poloniex.TestCredentials(marketConfig.Config["key"], marketConfig.Config["secret"], EXTERNAL_SERVICE_TIMEOUT_SECONDS)
if utils.ErrIs(err, markets.InvalidCredentials) {
return &Error{InvalidMarketCredentials, "wrong market credentials", fmt.Errorf("wrong '%v' market credentials", q.In.Market)}