mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 11:22:10 +08:00 
			
		
		
		
	fix
This commit is contained in:
		
							parent
							
								
									affa909e17
								
							
						
					
					
						commit
						3ef62d4aa5
					
				@ -49,7 +49,7 @@ func (ws *WsServer) ChangeOnlineStatus(concurrent int) {
 | 
				
			|||||||
				req := &pbuser.SetUserOnlineStatusReq{
 | 
									req := &pbuser.SetUserOnlineStatusReq{
 | 
				
			||||||
					Status: datautil.Slice(status, local2pb),
 | 
										Status: datautil.Slice(status, local2pb),
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				changeStatus[i] = status[0:]
 | 
									changeStatus[i] = status[:0]
 | 
				
			||||||
				select {
 | 
									select {
 | 
				
			||||||
				case requestChs[i] <- req:
 | 
									case requestChs[i] <- req:
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
@ -67,7 +67,7 @@ func (ws *WsServer) ChangeOnlineStatus(concurrent int) {
 | 
				
			|||||||
			req := &pbuser.SetUserOnlineStatusReq{
 | 
								req := &pbuser.SetUserOnlineStatusReq{
 | 
				
			||||||
				Status: datautil.Slice(status, local2pb),
 | 
									Status: datautil.Slice(status, local2pb),
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			changeStatus[i] = status[0:]
 | 
								changeStatus[i] = status[:0]
 | 
				
			||||||
			select {
 | 
								select {
 | 
				
			||||||
			case requestChs[i] <- req:
 | 
								case requestChs[i] <- req:
 | 
				
			||||||
			default:
 | 
								default:
 | 
				
			||||||
@ -100,6 +100,7 @@ func (ws *WsServer) ChangeOnlineStatus(concurrent int) {
 | 
				
			|||||||
		case now := <-scanTicker.C:
 | 
							case now := <-scanTicker.C:
 | 
				
			||||||
			pushUserState(ws.clients.GetAllUserStatus(now.Add(-cachekey.OnlineExpire/3), now)...)
 | 
								pushUserState(ws.clients.GetAllUserStatus(now.Add(-cachekey.OnlineExpire/3), now)...)
 | 
				
			||||||
		case state := <-ws.clients.UserState():
 | 
							case state := <-ws.clients.UserState():
 | 
				
			||||||
 | 
								log.ZDebug(context.Background(), "user online change", "userID", state.UserID, "online", state.Online, "offline", state.Offline)
 | 
				
			||||||
			pushUserState(state)
 | 
								pushUserState(state)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user