aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/apiv1-exec.go
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-10-01 11:51:47 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-10-16 14:57:58 +0200
commit5e979f0ba451e64fc44ffaa8b79d714d9ad75a57 (patch)
tree6fb6ba51e034ba361fd833b482fb061d4f918da7 /lib/xdsserver/apiv1-exec.go
parent4982769bd48b5c67c5eff4d9c6f297fa2a7531a4 (diff)
update xds-server package in docker
scripts/package-update: bash scripts to update xds-server package in docker monitor updates: default time is 24h, a update is tried at startup api/v1: 2 new requests: - get(updates): return various information about xds-server packages - post(updates): update xds-server packages Change-Id: I1673f7860e57cfe1d4abe5a24609ee46a90b67d8 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
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
}