Browse Source

get all nodes on startup

abhishek9686 9 months ago
parent
commit
cbe660fbf2
2 changed files with 1 additions and 3 deletions
  1. 0 3
      logic/nodes.go
  2. 1 0
      migrate/migrate.go

+ 0 - 3
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
 		}

+ 1 - 0
migrate/migrate.go

@@ -20,6 +20,7 @@ import (
 
 // Run - runs all migrations
 func Run() {
+	_, _ = logic.GetAllNodes()
 	updateEnrollmentKeys()
 	assignSuperAdmin()
 	createDefaultTagsAndPolicies()