Commit 805b50be authored by Cranky Kernel's avatar Cranky Kernel

get-account-info: get new binance client each time

In case the configuration changes after start, like the first
time the app is used.
parent 117cb170
Pipeline #53038740 passed with stage
in 14 minutes and 5 seconds
......@@ -16,7 +16,6 @@
package server
import (
"github.com/crankykernel/binanceapi-go"
"github.com/gorilla/mux"
"gitlab.com/crankykernel/maker/go/binanceex"
"gitlab.com/crankykernel/maker/go/log"
......@@ -24,13 +23,10 @@ import (
)
type BinanceProxyHandlers struct {
client *binanceapi.RestClient
}
func NewBinanceProxyHandlers() *BinanceProxyHandlers {
return &BinanceProxyHandlers{
client: binanceex.GetBinanceRestClient(),
}
return &BinanceProxyHandlers{}
}
func (h *BinanceProxyHandlers) RegisterHandlers(router *mux.Router) {
......@@ -38,7 +34,8 @@ func (h *BinanceProxyHandlers) RegisterHandlers(router *mux.Router) {
}
func (h *BinanceProxyHandlers) GetAccount(w http.ResponseWriter, r *http.Request) {
response, err := h.client.GetAccount()
client := binanceex.GetBinanceRestClient()
response, err := client.GetAccount()
if err != nil {
log.WithError(err).Errorf("Binance GetAccount request failed")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment