fix: handle panics in tailscale service

This commit is contained in:
Stavros
2026-05-20 23:01:14 +03:00
parent 1166a15aa7
commit 9b50670925
2 changed files with 14 additions and 5 deletions
+6 -2
View File
@@ -15,6 +15,10 @@ import (
"tailscale.com/tsnet"
)
var (
TsnetErrClosed = errors.New("tsnet: use of closed network connection")
)
type TailscaleWhoisResponse struct {
UserID string
LoginName string
@@ -99,10 +103,10 @@ func (ts *TailscaleService) watchAndClose() {
ts.srv = nil
ts.mu.Unlock()
if ln != nil {
(*ts.ln).Close()
(*ln).Close()
}
if srv != nil {
ts.srv.Close()
srv.Close()
}
}