Skip to content

消息重复订阅 #77

Open
Open

Description

@BadSeven

func (p *BitgetWsClient) Subscribe(list []model.SubscribeReq, listener common.OnReceive) {

var args []interface{}
for i := 0; i < len(list); i++ {
    req := toUpperReq(list[i])
    args = append(args, req)

    p.bitgetBaseWsClient.ScribeMap[req] = listener
    p.bitgetBaseWsClient.AllSuribe.Add(req)
    // 删除这行重复的添加:args = append(args, req) 存在重复添加的问题
}

wsBaseReq := model.WsBaseReq{
    Op:   constants.WsOpSubscribe,
    Args: args,
}

p.bitgetBaseWsClient.SendByType(wsBaseReq)

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions