Skip to content

Commit 88f5be2

Browse files
author
hero
committed
添加推送服务
1 parent 60b6c71 commit 88f5be2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

go_push/gateway/push_job.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ func (p *PushTask) distributionTask() {
5252
if pushJob.Type == 1 {
5353
GetRoomManage().PushAll(&WSMessage{
5454
Type: pushJob.PushType,
55-
Data: pushJob.info,
55+
Data: pushJob.Info,
5656
})
5757
} else if pushJob.Type == 2 {
58-
p.JobChan[pushJob.roomId] <- pushJob
58+
p.JobChan[pushJob.RoomId] <- pushJob
5959
}
6060
}
6161
}
@@ -71,7 +71,7 @@ func (p *PushTask) pushWork(roomId int) {
7171
case job = <-p.JobChan[roomId]:
7272
if err = GetRoomManage().PushRoom(roomId, &WSMessage{
7373
Type: job.PushType,
74-
Data: job.info,
74+
Data: job.Info,
7575
}); err != nil {
7676
fmt.Println(err)
7777
}

go_push/gateway/ws_handle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (w *WsConnection) CloseConn() {
3434
w.close()
3535
GetRoomManage().DelConn(w)
3636
w.addRoom.Range(func(key, _ interface{}) bool {
37-
_ = GetRoomManage().LeaveRoom(key.(int), w)
37+
_ = GetRoomManage().LeaveRoom(key.(int), w.GetWsId())
3838
w.addRoom.Delete(key)
3939
return true
4040
})

0 commit comments

Comments
 (0)