MCPcopy
hub / github.com/wavetermdev/waveterm / Stop

Method Stop

pkg/blockcontroller/tsunamicontroller.go:239–266  ·  view source on GitHub ↗
(graceful bool, newStatus string, destroy bool)

Source from the content-addressed store, hash-verified

237}
238
239func (c *TsunamiController) Stop(graceful bool, newStatus string, destroy bool) {
240 log.Printf("TsunamiController.Stop called for block %s (graceful: %t, newStatus: %s)", c.blockId, graceful, newStatus)
241 c.runLock.Lock()
242 defer c.runLock.Unlock()
243
244 if c.tsunamiProc == nil {
245 return
246 }
247
248 if c.tsunamiProc.Cmd.Process != nil {
249 c.tsunamiProc.Cmd.Process.Kill()
250 }
251
252 if c.tsunamiProc.StdinWriter != nil {
253 c.tsunamiProc.StdinWriter.Close()
254 }
255
256 c.tsunamiProc = nil
257 if newStatus == "" {
258 newStatus = Status_Done
259 }
260 c.WithStatusLock(func() {
261 c.status = newStatus
262 c.port = 0
263 })
264 c.clearSchemas()
265 go c.sendStatusUpdate()
266}
267
268func (c *TsunamiController) GetRuntimeStatus() *BlockControllerRuntimeStatus {
269 var rtn *BlockControllerRuntimeStatus

Callers

nothing calls this directly

Calls 5

WithStatusLockMethod · 0.95
clearSchemasMethod · 0.95
sendStatusUpdateMethod · 0.95
KillMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected