添加 推送到渲染集群超时
This commit is contained in:
parent
8358a4fd2e
commit
40b1163cc1
2
main.go
2
main.go
|
@ -36,7 +36,7 @@ var DequeueHandler = triggered.RegisterExecute(func(params *triggered.Params[boo
|
|||
return
|
||||
}
|
||||
|
||||
log.Println(item)
|
||||
// log.Println(item)
|
||||
PopChannel <- item
|
||||
}
|
||||
})
|
||||
|
|
17
websocket.go
17
websocket.go
|
@ -68,6 +68,14 @@ func queueHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
err = conn.SetWriteDeadline(time.Now().Add(time.Second * 15))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
log.Println("重新回队")
|
||||
stateClient.PushItem(nil, item)
|
||||
return
|
||||
}
|
||||
|
||||
// 写回消息
|
||||
err = conn.WriteMessage(websocket.BinaryMessage, wdata)
|
||||
if err != nil {
|
||||
|
@ -78,15 +86,6 @@ func queueHandler(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
// 打印消息
|
||||
fmt.Printf("%s 处理完成. len\n", conn.RemoteAddr())
|
||||
|
||||
// 读取消息
|
||||
// msgType, msg, err := conn.ReadMessage()
|
||||
|
||||
// if err != nil {
|
||||
// log.Println(msgType, msg, err)
|
||||
// return
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user