We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f46a481 commit 897f03eCopy full SHA for 897f03e
1 file changed
service/msap/msap.go
@@ -216,6 +216,29 @@ func sync(c *gin.Context) {
216
return
217
}
218
219
+ go func() {
220
+ for {
221
+ time.Sleep(30 * time.Second)
222
+ select {
223
+ case <-c.Request.Context().Done():
224
+ return
225
+ default:
226
+ jsonData, err := json.Marshal(gin.H{
227
+ "result": gin.H{
228
+ "code": errorcode.Success,
229
+ "msg": "",
230
+ },
231
+ "msg": []gin.H{},
232
+ })
233
+ fmt.Fprintf(w, "data: %s\n\n", jsonData)
234
+ flusher.Flush()
235
+ if err != nil {
236
237
+ }
238
239
240
+ }()
241
+
242
// 循环从gRPC流中接收消息并发送到SSE客户端
243
for {
244
select {
0 commit comments