Skip to content

消息重复订阅 #77

@BadSeven

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)

}

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