refactor(init): run docker network creation and firewall setup in a goroutine (#7336)

pull/7337/head
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
1 changed files with 6 additions and 4 deletions

View File

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