mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
kucoin: replace UnixMilli
This commit is contained in:
parent
e76dd1cbc4
commit
d433c7f5b1
|
@ -74,7 +74,7 @@ var websocketCmd = &cobra.Command{
|
|||
|
||||
defer c.Close()
|
||||
|
||||
id := time.Now().UnixMilli()
|
||||
id := time.Now().UnixNano() / int64(time.Millisecond)
|
||||
wsCmds := []kucoin.WebSocketCommand{
|
||||
/*
|
||||
{
|
||||
|
@ -125,7 +125,7 @@ var websocketCmd = &cobra.Command{
|
|||
|
||||
case <-pingTicker.C:
|
||||
if err := c.WriteJSON(kucoin.WebSocketCommand{
|
||||
Id: time.Now().UnixMilli(),
|
||||
Id: time.Now().UnixNano() / int64(time.Millisecond),
|
||||
Type: "ping",
|
||||
}); err != nil {
|
||||
logrus.WithError(err).Error("websocket ping error", err)
|
||||
|
|
|
@ -94,7 +94,7 @@ func toLocalInterval(i types.Interval) string {
|
|||
|
||||
// convertSubscriptions global subscription to local websocket command
|
||||
func convertSubscriptions(ss []types.Subscription) ([]WebSocketCommand, error) {
|
||||
var id = time.Now().UnixMilli()
|
||||
var id = time.Now().UnixNano() / int64(time.Millisecond)
|
||||
var cmds []WebSocketCommand
|
||||
for _, s := range ss {
|
||||
id++
|
||||
|
|
|
@ -137,7 +137,7 @@ func (s *Stream) handleConnect() {
|
|||
return
|
||||
}
|
||||
} else {
|
||||
id := time.Now().UnixMilli()
|
||||
id := time.Now().UnixNano() / int64(time.Millisecond)
|
||||
cmds := []WebSocketCommand{
|
||||
{
|
||||
Id: id,
|
||||
|
@ -406,7 +406,7 @@ func ping(ctx context.Context, w WebSocketConnector, interval time.Duration) {
|
|||
conn := w.Conn()
|
||||
|
||||
if err := conn.WriteJSON(WebSocketCommand{
|
||||
Id: time.Now().UnixMilli(),
|
||||
Id: time.Now().UnixNano() / int64(time.Millisecond),
|
||||
Type: "ping",
|
||||
}); err != nil {
|
||||
log.WithError(err).Error("websocket ping error", err)
|
||||
|
|
Loading…
Reference in New Issue
Block a user