1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

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

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) {