mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05: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) {
|
||||
h.Lock()
|
||||
h.cache[session] = time.Now().Add(time.Minute * 3)
|
||||
h.Unlock()
|
||||
|
||||
select {
|
||||
case <-h.token.Wait():
|
||||
go h.run()
|
||||
default:
|
||||
}
|
||||
|
||||
h.Unlock()
|
||||
}
|
||||
|
||||
func (h *SessionHistory) has(session sessionId) bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user