mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-03 15:05:28 +00: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:
parent
591ff8d347
commit
3bef63bb80
@ -318,11 +318,8 @@ func (hsdb *HSDatabase) MachineSetExpiry(machine *types.Machine, expiry time.Tim
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (hsdb *HSDatabase) machineSetExpiry(machine *types.Machine, expiry time.Time) error {
|
func (hsdb *HSDatabase) machineSetExpiry(machine *types.Machine, expiry time.Time) error {
|
||||||
now := time.Now()
|
|
||||||
|
|
||||||
if err := hsdb.db.Model(machine).Updates(types.Machine{
|
if err := hsdb.db.Model(machine).Updates(types.Machine{
|
||||||
LastSuccessfulUpdate: &now,
|
Expiry: &expiry,
|
||||||
Expiry: &expiry,
|
|
||||||
}).Error; err != nil {
|
}).Error; err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
"failed to refresh machine (update expiration) in the database: %w",
|
"failed to refresh machine (update expiration) in the database: %w",
|
||||||
|
@ -532,9 +532,8 @@ func (api headscaleV1APIServer) DebugCreateMachine(
|
|||||||
GivenName: givenName,
|
GivenName: givenName,
|
||||||
User: *user,
|
User: *user,
|
||||||
|
|
||||||
Expiry: &time.Time{},
|
Expiry: &time.Time{},
|
||||||
LastSeen: &time.Time{},
|
LastSeen: &time.Time{},
|
||||||
LastSuccessfulUpdate: &time.Time{},
|
|
||||||
|
|
||||||
HostInfo: types.HostInfo(hostinfo),
|
HostInfo: types.HostInfo(hostinfo),
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,8 @@ type Machine struct {
|
|||||||
AuthKeyID uint
|
AuthKeyID uint
|
||||||
AuthKey *PreAuthKey
|
AuthKey *PreAuthKey
|
||||||
|
|
||||||
LastSeen *time.Time
|
LastSeen *time.Time
|
||||||
LastSuccessfulUpdate *time.Time
|
Expiry *time.Time
|
||||||
Expiry *time.Time
|
|
||||||
|
|
||||||
HostInfo HostInfo
|
HostInfo HostInfo
|
||||||
Endpoints StringList
|
Endpoints StringList
|
||||||
@ -246,12 +245,6 @@ func (machine *Machine) Proto() *v1.Machine {
|
|||||||
machineProto.LastSeen = timestamppb.New(*machine.LastSeen)
|
machineProto.LastSeen = timestamppb.New(*machine.LastSeen)
|
||||||
}
|
}
|
||||||
|
|
||||||
if machine.LastSuccessfulUpdate != nil {
|
|
||||||
machineProto.LastSuccessfulUpdate = timestamppb.New(
|
|
||||||
*machine.LastSuccessfulUpdate,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if machine.Expiry != nil {
|
if machine.Expiry != nil {
|
||||||
machineProto.Expiry = timestamppb.New(*machine.Expiry)
|
machineProto.Expiry = timestamppb.New(*machine.Expiry)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user