From f5c2c356a7d642222e623d4b407385237d365e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thor=20Anker=20Kvisg=C3=A5rd=20Lange?= Date: Fri, 26 Jan 2024 14:32:47 +0100 Subject: [PATCH] fix: Removing version checking from creation also --- server/store/datastore/agent.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/store/datastore/agent.go b/server/store/datastore/agent.go index 419f1f13af..3f0ac59165 100644 --- a/server/store/datastore/agent.go +++ b/server/store/datastore/agent.go @@ -43,7 +43,9 @@ func (s storage) AgentFindByToken(token string) (*model.Agent, error) { func (s storage) AgentCreate(agent *model.Agent) error { // only Insert set auto created ID back to object - _, err := s.engine.Insert(agent) + sess := s.engine.NewSession() + defer sess.Close() + _, err := sess.NoVersionCheck().Insert(agent) return err }