mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-30 07:46:41 -04:00
update wait logic
This commit is contained in:
parent
23a8da215f
commit
52ee3ff79c
@ -23,20 +23,17 @@ func (t *ActivityTimer) run() {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-time.After(t.timeout):
|
case <-time.After(t.timeout):
|
||||||
t.cancel()
|
|
||||||
return
|
|
||||||
case <-t.ctx.Done():
|
case <-t.ctx.Done():
|
||||||
return
|
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