aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/apiv1-exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xdsserver/apiv1-exec.go')
-rw-r--r--lib/xdsserver/apiv1-exec.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/xdsserver/apiv1-exec.go b/lib/xdsserver/apiv1-exec.go
index 57ea1f1..aea34e4 100644
--- a/lib/xdsserver/apiv1-exec.go
+++ b/lib/xdsserver/apiv1-exec.go
@@ -261,6 +261,7 @@ func (s *APIService) execCmd(c *gin.Context) {
execWS.ExitCB = func(e *eows.ExecOverWS, code int, err error) {
s.Log.Debugf("Command [Cmd ID %s] exited: code %d, error: %v", e.CmdID, code, err)
+ defer LockXdsUpdateCounter(s.Context, false)
// Close client tty
defer func() {
if gdbPty != nil {
@@ -330,8 +331,10 @@ func (s *APIService) execCmd(c *gin.Context) {
// Start command execution
s.Log.Infof("Execute [Cmd ID %s]: %v %v", execWS.CmdID, execWS.Cmd, execWS.Args)
+ LockXdsUpdateCounter(s.Context, true)
err = execWS.Start()
if err != nil {
+ LockXdsUpdateCounter(s.Context, false)
common.APIError(c, err.Error())
return
}