1
0
mirror of https://github.com/juanfont/headscale.git synced 2024-12-20 19:09:07 +01:00

Remove LastSuccessfulUpdate from Machine

This field is no longer used, it was used in our old state
"algorithm" to determine if we should send an update.

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-09-11 06:23:29 -05:00 committed by Kristoffer Dalby
parent 591ff8d347
commit 3bef63bb80
3 changed files with 5 additions and 16 deletions

View File

@ -318,10 +318,7 @@ func (hsdb *HSDatabase) MachineSetExpiry(machine *types.Machine, expiry time.Tim
}
func (hsdb *HSDatabase) machineSetExpiry(machine *types.Machine, expiry time.Time) error {
now := time.Now()
if err := hsdb.db.Model(machine).Updates(types.Machine{
LastSuccessfulUpdate: &now,
Expiry: &expiry,
}).Error; err != nil {
return fmt.Errorf(

View File

@ -534,7 +534,6 @@ func (api headscaleV1APIServer) DebugCreateMachine(
Expiry: &time.Time{},
LastSeen: &time.Time{},
LastSuccessfulUpdate: &time.Time{},
HostInfo: types.HostInfo(hostinfo),
}

View File

@ -54,7 +54,6 @@ type Machine struct {
AuthKey *PreAuthKey
LastSeen *time.Time
LastSuccessfulUpdate *time.Time
Expiry *time.Time
HostInfo HostInfo
@ -246,12 +245,6 @@ func (machine *Machine) Proto() *v1.Machine {
machineProto.LastSeen = timestamppb.New(*machine.LastSeen)
}
if machine.LastSuccessfulUpdate != nil {
machineProto.LastSuccessfulUpdate = timestamppb.New(
*machine.LastSuccessfulUpdate,
)
}
if machine.Expiry != nil {
machineProto.Expiry = timestamppb.New(*machine.Expiry)
}