fix: error response for docker

This commit is contained in:
2022-12-29 14:58:31 +00:00
parent 713500413c
commit f959b70ab9

View File

@@ -110,6 +110,10 @@ func Server() error {
// access container // access container
resp, err := docker.BuildRunContainer(PortsInt, GPU, ContainerName) resp, err := docker.BuildRunContainer(PortsInt, GPU, ContainerName)
if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
}
if ProxyIpAddr.Ipv4 != "" { if ProxyIpAddr.Ipv4 != "" {
err := frp.StartFRPCDockerContainer(ProxyIpAddr.Ipv4, ProxyIpAddr.ProxyPort, resp) err := frp.StartFRPCDockerContainer(ProxyIpAddr.Ipv4, ProxyIpAddr.ProxyPort, resp)
if err != nil { if err != nil {
@@ -117,10 +121,6 @@ func Server() error {
} }
} }
if err != nil {
c.String(http.StatusInternalServerError, fmt.Sprintf("error: %s", err))
}
c.JSON(http.StatusOK, resp) c.JSON(http.StatusOK, resp)
}) })