binance: rename to timeSetterOnce

This commit is contained in:
c9s 2022-07-26 16:22:57 +08:00
parent cf5e81c848
commit ff61235e70
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -82,7 +82,7 @@ type Exchange struct {
client2 *binanceapi.RestClient
}
var timeSetter sync.Once
var timeSetterOnce sync.Once
func New(key, secret string) *Exchange {
var client = binance.NewClient(key, secret)
@ -125,7 +125,7 @@ func New(key, secret string) *Exchange {
}
ctx := context.Background()
go timeSetter.Do(func() {
go timeSetterOnce.Do(func() {
setServerTime(ctx)
ticker := time.NewTicker(time.Hour)