error auth refresh if server not running

This commit is contained in:
Fran Bull 2025-02-26 08:29:13 -08:00
parent 5fa145674d
commit febe30ea68

View File

@ -5,10 +5,12 @@ package tsconsensus
import (
"context"
"errors"
"net/netip"
"slices"
"sync"
"tailscale.com/ipn"
"tailscale.com/ipn/ipnstate"
"tailscale.com/tsnet"
)
@ -29,6 +31,9 @@ func (a *authorization) refresh(ctx context.Context) error {
if err != nil {
return err
}
if tStatus.BackendState != ipn.Running.String() {
return errors.New("ts Server is not running")
}
a.mu.Lock()
defer a.mu.Unlock()
a.peers = newPeers(tStatus)