setLastStateChangeToNow was always receiving nil

This commit is contained in:
Juan Font Alonso 2022-09-04 11:37:49 +02:00
parent f2fda4f906
commit 0d074b1da6

16
app.go
View file

@ -860,19 +860,17 @@ func (h *Headscale) getTLSSettings() (*tls.Config, error) {
} }
} }
func (h *Headscale) setLastStateChangeToNow(namespaces ...string) { func (h *Headscale) setLastStateChangeToNow() {
var err error var err error
now := time.Now().UTC() now := time.Now().UTC()
if len(namespaces) == 0 { namespaces, err := h.ListNamespacesStr()
namespaces, err = h.ListNamespacesStr() if err != nil {
if err != nil { log.Error().
log.Error(). Caller().
Caller(). Err(err).
Err(err). Msg("failed to fetch all namespaces, failing to update last changed state.")
Msg("failed to fetch all namespaces, failing to update last changed state.")
}
} }
for _, namespace := range namespaces { for _, namespace := range namespaces {