fix 5个用户删除最开的

This commit is contained in:
Theluyuan 2023-06-15 10:47:25 +08:00
parent cb4b4db6b8
commit 40cda264e2

View File

@ -35,6 +35,10 @@ const SSE_CONF = {
router.get('/msg', KoaSSEStream(SSE_CONF), ctx => {
// 每次连接会进行一个 push
clientList.push(ctx.sse);
if(clientList.length > 5){
// 删除
clientList.shift()
}
})
let start = false
function startDown(){