mirror of
				https://github.com/v2fly/v2ray-core.git
				synced 2025-10-31 01:39:16 +00:00 
			
		
		
		
	refactor
This commit is contained in:
		
							parent
							
								
									2ad0e359ef
								
							
						
					
					
						commit
						4668f9d3de
					
				| @ -45,14 +45,13 @@ func NewSessionHistory(ctx context.Context) *SessionHistory { | |||||||
| func (h *SessionHistory) add(session sessionId) { | func (h *SessionHistory) add(session sessionId) { | ||||||
| 	h.Lock() | 	h.Lock() | ||||||
| 	h.cache[session] = time.Now().Add(time.Minute * 3) | 	h.cache[session] = time.Now().Add(time.Minute * 3) | ||||||
|  | 	h.Unlock() | ||||||
| 
 | 
 | ||||||
| 	select { | 	select { | ||||||
| 	case <-h.token.Wait(): | 	case <-h.token.Wait(): | ||||||
| 		go h.run() | 		go h.run() | ||||||
| 	default: | 	default: | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	h.Unlock() |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (h *SessionHistory) has(session sessionId) bool { | func (h *SessionHistory) has(session sessionId) bool { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Darien Raymond
						Darien Raymond