From cbe660fbf2134a20c22e1be0a3329755160bc29f Mon Sep 17 00:00:00 2001 From: abhishek9686 Date: Wed, 27 Nov 2024 15:01:26 +0400 Subject: [PATCH] get all nodes on startup --- logic/nodes.go | 3 --- migrate/migrate.go | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/logic/nodes.go b/logic/nodes.go index 94e7199d..34eebe2e 100644 --- a/logic/nodes.go +++ b/logic/nodes.go @@ -445,9 +445,6 @@ func GetRecordKey(id string, network string) (string, error) { func GetNodeByID(uuid string) (models.Node, error) { if servercfg.CacheEnabled() { - if len(getNodesFromCache()) == 0 { - _, _ = GetAllNodes() - } if node, ok := getNodeFromCache(uuid); ok { return node, nil } diff --git a/migrate/migrate.go b/migrate/migrate.go index 19e9232a..e86f4199 100644 --- a/migrate/migrate.go +++ b/migrate/migrate.go @@ -20,6 +20,7 @@ import ( // Run - runs all migrations func Run() { + _, _ = logic.GetAllNodes() updateEnrollmentKeys() assignSuperAdmin() createDefaultTagsAndPolicies()