From a369d57a1736c370b17ac9530be73e1b589f69a9 Mon Sep 17 00:00:00 2001 From: dyz Date: Mon, 22 Jan 2024 00:38:24 +0800 Subject: [PATCH] fix node expire error due to type in gorm model Update (#1692) Fixes #1674 Signed-off-by: fortitude.zhang --- hscontrol/db/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hscontrol/db/node.go b/hscontrol/db/node.go index 880a0e14..e2a82cc3 100644 --- a/hscontrol/db/node.go +++ b/hscontrol/db/node.go @@ -900,7 +900,7 @@ func (hsdb *HSDatabase) ExpireExpiredNodes(lastCheck time.Time) time.Time { // Do not use setNodeExpiry as that has a notifier hook, which // can cause a deadlock, we are updating all changed nodes later // and there is no point in notifiying twice. - if err := hsdb.db.Model(nodes[index]).Updates(types.Node{ + if err := hsdb.db.Model(&nodes[index]).Updates(types.Node{ Expiry: &started, }).Error; err != nil { log.Error().