refactor(init): run docker network creation and firewall setup in a goroutine (#7336)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 6s

This commit is contained in:
igophper 2024-12-11 22:33:37 +08:00 committed by GitHub
parent 75d94f5b89
commit 2c8dad980b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,11 +31,13 @@ func Init() {
createDir(fileOp, dir) createDir(fileOp, dir)
} }
_ = docker.CreateDefaultDockerNetwork() go func() {
_ = docker.CreateDefaultDockerNetwork()
if f, err := firewall.NewFirewallClient(); err == nil { if f, err := firewall.NewFirewallClient(); err == nil {
_ = f.EnableForward() _ = f.EnableForward()
} }
}()
} }
func createDir(fileOp files.FileOp, dirPath string) { func createDir(fileOp files.FileOp, dirPath string) {