qbtrade/pkg/exchange/retry/ticker.go
2024-06-27 22:42:38 +08:00

18 lines
354 B
Go

package retry
import (
"context"
"git.qtrade.icu/lychiyu/qbtrade/pkg/types"
)
func QueryTickerUntilSuccessful(ctx context.Context, ex types.Exchange, symbol string) (ticker *types.Ticker, err error) {
var op = func() (err2 error) {
ticker, err2 = ex.QueryTicker(ctx, symbol)
return err2
}
err = GeneralBackoff(ctx, op)
return ticker, err
}