From 2c8dad980b80a7ce3424d9bd0cada09c80be5a8d Mon Sep 17 00:00:00 2001 From: igophper <34326532+igophper@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:33:37 +0800 Subject: [PATCH] refactor(init): run docker network creation and firewall setup in a goroutine (#7336) --- backend/init/app/app.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/init/app/app.go b/backend/init/app/app.go index 422657961..f89f8b60f 100644 --- a/backend/init/app/app.go +++ b/backend/init/app/app.go @@ -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) {