mirror of
https://github.com/v2ray/v2ray-core.git
synced 2024-04-21 12:31:52 +00:00
update wait logic
This commit is contained in:
+8
-11
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user