setLastStateChangeToNow was always receiving nil
This commit is contained in:
parent
f2fda4f906
commit
0d074b1da6
1 changed files with 7 additions and 9 deletions
6
app.go
6
app.go
|
@ -860,20 +860,18 @@ 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 {
|
||||||
lastStateUpdate.WithLabelValues(namespace, "headscale").Set(float64(now.Unix()))
|
lastStateUpdate.WithLabelValues(namespace, "headscale").Set(float64(now.Unix()))
|
||||||
|
|
Loading…
Reference in a new issue