mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-29 18:33:05 +00:00
Fix errors introduced by merge
This commit is contained in:
parent
0676aa11a9
commit
a19af04582
2 changed files with 7 additions and 4 deletions
|
@ -420,7 +420,7 @@ func (h *Headscale) RenameMachine(machine *Machine, newName string) error {
|
||||||
|
|
||||||
h.setLastStateChangeToNow(machine.Namespace.Name)
|
h.setLastStateChangeToNow(machine.Namespace.Name)
|
||||||
|
|
||||||
if err := h.db.Save(machine).Error; err != nil {
|
if err := h.db.Save(machine).Error; err != nil {
|
||||||
return fmt.Errorf("failed to rename machine in the database: %w", err)
|
return fmt.Errorf("failed to rename machine in the database: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ func (h *Headscale) RenameMachine(machine *Machine, newName string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// RefreshMachine takes a Machine struct and sets the expire field to now.
|
// RefreshMachine takes a Machine struct and sets the expire field to now.
|
||||||
func (h *Headscale) RefreshMachine(machine *Machine, expiry time.Time) {
|
func (h *Headscale) RefreshMachine(machine *Machine, expiry time.Time) error {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
||||||
machine.LastSuccessfulUpdate = &now
|
machine.LastSuccessfulUpdate = &now
|
||||||
|
@ -437,7 +437,10 @@ func (h *Headscale) RefreshMachine(machine *Machine, expiry time.Time) {
|
||||||
h.setLastStateChangeToNow(machine.Namespace.Name)
|
h.setLastStateChangeToNow(machine.Namespace.Name)
|
||||||
|
|
||||||
if err := h.db.Save(machine).Error; err != nil {
|
if err := h.db.Save(machine).Error; err != nil {
|
||||||
return fmt.Errorf("failed to refresh machine (update expiration) in the database: %w", err)
|
return fmt.Errorf(
|
||||||
|
"failed to refresh machine (update expiration) in the database: %w",
|
||||||
|
err,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
2
poll.go
2
poll.go
|
@ -121,7 +121,7 @@ func (h *Headscale) PollNetMapHandler(ctx *gin.Context) {
|
||||||
log.Error().
|
log.Error().
|
||||||
Str("handler", "PollNetMap").
|
Str("handler", "PollNetMap").
|
||||||
Str("id", ctx.Param("id")).
|
Str("id", ctx.Param("id")).
|
||||||
Str("machine", machine.Name).
|
Str("machine", machine.Hostname).
|
||||||
Err(err).
|
Err(err).
|
||||||
Msg("Failed to persist/update machine in the database")
|
Msg("Failed to persist/update machine in the database")
|
||||||
ctx.String(http.StatusInternalServerError, ":(")
|
ctx.String(http.StatusInternalServerError, ":(")
|
||||||
|
|
Loading…
Reference in a new issue