mirror of https://github.com/v2ray/v2ray-core
refactor
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…
Reference in New Issue