MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / reCreateRuntime

Function reCreateRuntime

agent/app/service/runtime_utils.go:162–180  ·  view source on GitHub ↗
(runtime *model.Runtime)

Source from the content-addressed store, hash-verified

160}
161
162func reCreateRuntime(runtime *model.Runtime) {
163 var err error
164 defer func() {
165 if err != nil {
166 runtime.Status = constant.StatusError
167 runtime.Message = err.Error()
168 _ = runtimeRepo.Save(runtime)
169 }
170 }()
171 if err = runComposeCmdWithLog("down", runtime.GetComposePath(), runtime.GetLogPath()); err != nil {
172 return
173 }
174 if err = runComposeCmdWithLog("up", runtime.GetComposePath(), runtime.GetLogPath()); err != nil {
175 return
176 }
177 if err := SyncRuntimeContainerStatus(runtime); err != nil {
178 return
179 }
180}
181
182func getComposeCmd(composePath, operate string) *exec.Cmd {
183 dockerCommand := global.CONF.DockerConfig.Command

Callers 2

UpdateMethod · 0.85
UpdatePHPContainerMethod · 0.85

Calls 6

runComposeCmdWithLogFunction · 0.85
SaveMethod · 0.65
ErrorMethod · 0.45
GetComposePathMethod · 0.45
GetLogPathMethod · 0.45

Tested by

no test coverage detected