Convert missing from api.go

This commit is contained in:
Kristoffer Dalby 2021-08-05 18:16:21 +01:00
parent ee704f8ef3
commit 0bb2fabc6c
No known key found for this signature in database
GPG Key ID: 09F62DC067465735

10
api.go
View File

@ -92,7 +92,10 @@ func (h *Headscale) RegistrationHandler(c *gin.Context) {
NodeKey: wgkey.Key(req.NodeKey).HexString(), NodeKey: wgkey.Key(req.NodeKey).HexString(),
} }
if err := h.db.Create(&m).Error; err != nil { if err := h.db.Create(&m).Error; err != nil {
log.Printf("Could not create row: %s", err) log.Error().
Str("Handler", "Registration").
Err(err).
Msg("Could not create row")
return return
} }
} }
@ -335,7 +338,10 @@ func (h *Headscale) PollNetMapHandler(c *gin.Context) {
Msg("Sending initial map") Msg("Sending initial map")
pollData <- *data pollData <- *data
log.Printf("[PollMap] (%s) Notifying peers", m.Name) log.Info().
Str("Handler", "PollNetMap").
Str("Machine", m.Name).
Msg("Notifying peers")
peers, _ := h.getPeers(m) peers, _ := h.getPeers(m)
h.pollMu.Lock() h.pollMu.Lock()
for _, p := range *peers { for _, p := range *peers {