From 7f453aa145415b3cdb6d633a16b704e311e53984 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:08:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=AF=E5=8A=A8=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E7=BD=91?= =?UTF-8?q?=E7=BB=9C=E6=A3=80=E6=B5=8B=20(#6820)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/runtime.go | 3 +++ backend/app/service/website.go | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/app/service/runtime.go b/backend/app/service/runtime.go index f4d279031..b1ed2a0db 100644 --- a/backend/app/service/runtime.go +++ b/backend/app/service/runtime.go @@ -495,6 +495,9 @@ func (r *RuntimeService) OperateRuntime(req request.RuntimeOperate) error { _ = runtimeRepo.Save(runtime) } }() + go func() { + _ = docker.CreateDefaultDockerNetwork() + }() switch req.Operate { case constant.RuntimeUp: if err = runComposeCmdWithLog(req.Operate, runtime.GetComposePath(), runtime.GetLogPath()); err != nil { diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 217f92f84..b55ee8a86 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -309,10 +309,6 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) if err != nil { return err } - if err = docker.CreateDefaultDockerNetwork(); err != nil { - err = buserr.WithDetail(constant.Err1PanelNetworkFailed, err.Error(), nil) - return - } website.RuntimeID = runtime.ID switch runtime.Type { case constant.RuntimePHP: