diff --git a/logic/acls.go b/logic/acls.go index 4cc887833..9a4dcb4aa 100644 --- a/logic/acls.go +++ b/logic/acls.go @@ -23,6 +23,7 @@ func CreateDefaultAclNetworkPolicies(netID models.NetworkID) { if netID.String() == "" { return } + _, _ = ListAcls(netID) if !IsAclExists(fmt.Sprintf("%s.%s", netID, "all-nodes")) { defaultDeviceAcl := models.Acl{ ID: fmt.Sprintf("%s.%s", netID, "all-nodes"), @@ -172,9 +173,6 @@ func InsertAcl(a models.Acl) error { func GetAcl(aID string) (models.Acl, error) { a := models.Acl{} if servercfg.CacheEnabled() { - if len(aclCacheMap) == 0 { - _ = listAcls() - } var ok bool a, ok = getAclFromCache(aID) if ok { diff --git a/migrate/migrate.go b/migrate/migrate.go index 19e9232aa..b4a866ab7 100644 --- a/migrate/migrate.go +++ b/migrate/migrate.go @@ -20,6 +20,8 @@ import ( // Run - runs all migrations func Run() { + _, _ = logic.GetAllNodes() + _, _ = logic.GetAllHosts() updateEnrollmentKeys() assignSuperAdmin() createDefaultTagsAndPolicies() diff --git a/netclient/ncutils/netclientutils.go b/netclient/ncutils/netclientutils.go index 9f79892d0..23fa9916d 100644 --- a/netclient/ncutils/netclientutils.go +++ b/netclient/ncutils/netclientutils.go @@ -6,7 +6,7 @@ import ( ) // DEFAULT_GC_PERCENT - garbage collection percent -const DEFAULT_GC_PERCENT = 10 +const DEFAULT_GC_PERCENT = 100 // == OS PATH FUNCTIONS ==