From 40cda264e2e61c87a0ecc9f2f794e3f13cf79996 Mon Sep 17 00:00:00 2001 From: Theluyuan <1162963624@qq.com> Date: Thu, 15 Jun 2023 10:47:25 +0800 Subject: [PATCH] =?UTF-8?q?fix=205=E4=B8=AA=E7=94=A8=E6=88=B7=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=80=E5=BC=80=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/router/index.js b/router/index.js index eb82a2a..5de8a43 100644 --- a/router/index.js +++ b/router/index.js @@ -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(){