mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-28 12:02:23 +00:00
ipn/ipnlocal: inline LocalBackend.getEngineStatus
For uniformity. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
0f4c0e558b
commit
3b58c118dd
@ -1437,16 +1437,6 @@ func (b *LocalBackend) InServerMode() bool {
|
|||||||
return b.inServerMode
|
return b.inServerMode
|
||||||
}
|
}
|
||||||
|
|
||||||
// getEngineStatus returns a copy of b.engineStatus.
|
|
||||||
//
|
|
||||||
// TODO(bradfitz): remove this and use Status() throughout.
|
|
||||||
func (b *LocalBackend) getEngineStatus() ipn.EngineStatus {
|
|
||||||
b.mu.Lock()
|
|
||||||
defer b.mu.Unlock()
|
|
||||||
|
|
||||||
return b.engineStatus
|
|
||||||
}
|
|
||||||
|
|
||||||
// Login implements Backend.
|
// Login implements Backend.
|
||||||
func (b *LocalBackend) Login(token *tailcfg.Oauth2Token) {
|
func (b *LocalBackend) Login(token *tailcfg.Oauth2Token) {
|
||||||
b.mu.Lock()
|
b.mu.Lock()
|
||||||
@ -2346,6 +2336,7 @@ func (b *LocalBackend) nextState() ipn.State {
|
|||||||
blocked = b.blocked
|
blocked = b.blocked
|
||||||
wantRunning = b.prefs.WantRunning
|
wantRunning = b.prefs.WantRunning
|
||||||
loggedOut = b.prefs.LoggedOut
|
loggedOut = b.prefs.LoggedOut
|
||||||
|
st = b.engineStatus
|
||||||
)
|
)
|
||||||
b.mu.Unlock()
|
b.mu.Unlock()
|
||||||
|
|
||||||
@ -2387,7 +2378,7 @@ func (b *LocalBackend) nextState() ipn.State {
|
|||||||
// (if we get here, we know MachineAuthorized == true)
|
// (if we get here, we know MachineAuthorized == true)
|
||||||
return ipn.Starting
|
return ipn.Starting
|
||||||
case state == ipn.Starting:
|
case state == ipn.Starting:
|
||||||
if st := b.getEngineStatus(); st.NumLive > 0 || st.LiveDERPs > 0 {
|
if st.NumLive > 0 || st.LiveDERPs > 0 {
|
||||||
return ipn.Running
|
return ipn.Running
|
||||||
} else {
|
} else {
|
||||||
return state
|
return state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user