|  | @@ -41,16 +41,11 @@ func (us *TimedUserSet) updateUserHash(tick <-chan time.Time) {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	hash2Remove := make(chan hashEntry, cacheDurationSec*2*len(us.validUserIds))
 |  |  	hash2Remove := make(chan hashEntry, cacheDurationSec*2*len(us.validUserIds))
 | 
											
												
													
														|  |  	lastSec2Remove := now.Unix()
 |  |  	lastSec2Remove := now.Unix()
 | 
											
												
													
														|  | -  log.Debug("Start updating")
 |  | 
 | 
											
												
													
														|  |  	for {
 |  |  	for {
 | 
											
												
													
														|  |  		now := <-tick
 |  |  		now := <-tick
 | 
											
												
													
														|  |  		nowSec := now.UTC().Unix()
 |  |  		nowSec := now.UTC().Unix()
 | 
											
												
													
														|  |      
 |  |      
 | 
											
												
													
														|  |      remove2Sec := nowSec - cacheDurationSec
 |  |      remove2Sec := nowSec - cacheDurationSec
 | 
											
												
													
														|  | -    
 |  | 
 | 
											
												
													
														|  | -    log.Debug("remove2Sec %d, to %d", lastSec2Remove, remove2Sec)
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -		
 |  | 
 | 
											
												
													
														|  |  		if remove2Sec > lastSec2Remove {
 |  |  		if remove2Sec > lastSec2Remove {
 | 
											
												
													
														|  |  			for lastSec2Remove+1 < remove2Sec {
 |  |  			for lastSec2Remove+1 < remove2Sec {
 | 
											
												
													
														|  |  				entry := <-hash2Remove
 |  |  				entry := <-hash2Remove
 | 
											
										
											
												
													
														|  | @@ -59,13 +54,10 @@ func (us *TimedUserSet) updateUserHash(tick <-chan time.Time) {
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |      
 |  |      
 | 
											
												
													
														|  | -    log.Debug("LastSec %d, to %d", lastSec, nowSec + updateIntervalSec)
 |  | 
 | 
											
												
													
														|  | -    
 |  | 
 | 
											
												
													
														|  |      for lastSec < nowSec + cacheDurationSec {
 |  |      for lastSec < nowSec + cacheDurationSec {
 | 
											
												
													
														|  |        for idx, id := range us.validUserIds {
 |  |        for idx, id := range us.validUserIds {
 | 
											
												
													
														|  |  				idHash := id.TimeHash(lastSec)
 |  |  				idHash := id.TimeHash(lastSec)
 | 
											
												
													
														|  |  				hash2Remove <- hashEntry{string(idHash), lastSec}
 |  |  				hash2Remove <- hashEntry{string(idHash), lastSec}
 | 
											
												
													
														|  | -        log.Debug("Hash: %v", idHash)
 |  | 
 | 
											
												
													
														|  |  				us.userHashes[string(idHash)] = idx
 |  |  				us.userHashes[string(idHash)] = idx
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |        lastSec ++
 |  |        lastSec ++
 |