NET-735: HA Support (#2701)

* cache enabled option, cache hosts data if only enabled

* cache nodes only when enabled

* cache extclients only when enabled

* cache acls only when enabled
This commit is contained in:
Abhishek K
2023-12-05 12:01:35 +04:00
committed by GitHub
parent 8b659b3d00
commit 2c4a27c53b
9 changed files with 123 additions and 44 deletions

View File

@@ -3,6 +3,7 @@ package nodeacls
import (
"github.com/gravitl/netmaker/database"
"github.com/gravitl/netmaker/logic/acls"
"github.com/gravitl/netmaker/servercfg"
)
// CreateNodeACL - inserts or updates a node ACL on given network and adds to state
@@ -87,6 +88,8 @@ func DeleteACLContainer(network NetworkID) error {
if err != nil {
return err
}
acls.DeleteAclFromCache(acls.ContainerID(network))
if servercfg.CacheEnabled() {
acls.DeleteAclFromCache(acls.ContainerID(network))
}
return nil
}