mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
hook up close block to backend to remove the running process
This commit is contained in:
@@ -108,6 +108,15 @@ func CreateBlock(bdef *BlockDef, rtOpts *RuntimeOpts) (*BlockData, error) {
|
||||
return blockData, nil
|
||||
}
|
||||
|
||||
func CloseBlock(blockId string) {
|
||||
bc := GetBlockController(blockId)
|
||||
if bc == nil {
|
||||
return
|
||||
}
|
||||
bc.Close()
|
||||
close(bc.InputCh)
|
||||
}
|
||||
|
||||
func GetBlockData(blockId string) *BlockData {
|
||||
globalLock.Lock()
|
||||
defer globalLock.Unlock()
|
||||
@@ -140,6 +149,12 @@ type RunShellOpts struct {
|
||||
TermSize shellexec.TermSize `json:"termsize,omitempty"`
|
||||
}
|
||||
|
||||
func (bc *BlockController) Close() {
|
||||
if bc.getShellProc() != nil {
|
||||
bc.ShellProc.Close()
|
||||
}
|
||||
}
|
||||
|
||||
func (bc *BlockController) DoRunShellCommand(rc *RunShellOpts) error {
|
||||
if bc.getShellProc() != nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user