fix 5个用户删除最开的
This commit is contained in:
		
							parent
							
								
									cb4b4db6b8
								
							
						
					
					
						commit
						40cda264e2
					
				@ -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(){
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user