mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
update wait logic
This commit is contained in:
parent
23a8da215f
commit
52ee3ff79c
@ -23,20 +23,17 @@ func (t *ActivityTimer) run() {
|
||||
for {
|
||||
select {
|
||||
case <-time.After(t.timeout):
|
||||
t.cancel()
|
||||
return
|
||||
case <-t.ctx.Done():
|
||||
return
|
||||
default:
|
||||
select {
|
||||
case <-time.After(t.timeout):
|
||||
t.cancel()
|
||||
return
|
||||
case <-t.ctx.Done():
|
||||
return
|
||||
case <-t.updated:
|
||||
}
|
||||
}
|
||||
select {
|
||||
case <-t.updated:
|
||||
// Updated keep waiting.
|
||||
default:
|
||||
t.cancel()
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user