Merge pull request #638 from kradalby/update-nodes-derp

Simplify DERP maps update function
This commit is contained in:
Juan Font 2022-06-12 15:26:20 +02:00 committed by GitHub
commit 6afd492095
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
derp.go
View file

@ -152,16 +152,7 @@ func (h *Headscale) scheduledDERPMapUpdateWorker(cancelChan <-chan struct{}) {
h.DERPMap.Regions[h.DERPServer.region.RegionID] = &h.DERPServer.region h.DERPMap.Regions[h.DERPServer.region.RegionID] = &h.DERPServer.region
} }
namespaces, err := h.ListNamespaces() h.setLastStateChangeToNow()
if err != nil {
log.Error().
Err(err).
Msg("Failed to fetch namespaces")
}
for _, namespace := range namespaces {
h.setLastStateChangeToNow(namespace.Name)
}
} }
} }
} }