Added some log messages

This commit is contained in:
Juan Font Alonso 2022-04-30 23:32:45 +02:00
parent 602edcd1d7
commit 841f811f35

View file

@ -375,6 +375,7 @@ func (h *Headscale) ExpireMachine(machine *Machine) {
now := time.Now() now := time.Now()
machine.Expiry = &now machine.Expiry = &now
log.Trace().Msgf("Expiring machine %s", machine.Name)
h.setLastStateChangeToNow(machine.Namespace.Name) h.setLastStateChangeToNow(machine.Namespace.Name)
h.db.Save(machine) h.db.Save(machine)
@ -387,6 +388,7 @@ func (h *Headscale) RefreshMachine(machine *Machine, expiry time.Time) {
machine.LastSuccessfulUpdate = &now machine.LastSuccessfulUpdate = &now
machine.Expiry = &expiry machine.Expiry = &expiry
log.Trace().Msgf("Refreshing machine %s", machine.Name)
h.setLastStateChangeToNow(machine.Namespace.Name) h.setLastStateChangeToNow(machine.Namespace.Name)
h.db.Save(machine) h.db.Save(machine)