From 35b03c1f89d7eb432c2959b3ed7670a90c6e7f26 Mon Sep 17 00:00:00 2001 From: "Heekyoung, Oh" Date: Wed, 19 Apr 2017 18:26:44 +0900 Subject: [PATCH] [TIC-Web] bug fixed. for the cancel button. - bug fixed. - image events distingush failed, canceled. Change-Id: I1fbe264815bd869b3f6ea6ff85dfaa901a931f8d Signed-off-by: Heekyoung, Oh --- controller/mic.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/controller/mic.js b/controller/mic.js index 30dc3e6..597c94f 100644 --- a/controller/mic.js +++ b/controller/mic.js @@ -89,7 +89,6 @@ Mic.process = function process(command, callback, jobId) { process.stdout.write(err); }); ps.on('error', callback.error); - ps.on('close', callback.close); ps.on('exit', callback.exit); return ps; }; @@ -148,22 +147,19 @@ Mic.create = function create(paramObj, io) { logger.error('MICProcess.error:' + out); sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FAIL, 'Failed (' + code + ')'); }, - close: function (code) { - logger.info('MICProcess.colse: all process were closed.') - }, exit: function (code) { logger.info('MICProcess.exit: Terminated (' + code + ')'); - if (!code) { - sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_CANCEL, { - msg: 'Canceled (' + code + ')', - jobId: strJobId - }); - } else if (code === 0) { + if (code === 0) { sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FINISH, { msg: 'Terminated (' + code + ')', jobId: strJobId, imageName: strPackto }); + } else if (code === null) { + sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_CANCEL, { + msg: 'Canceled (' + code + ')', + jobId: strJobId + }); } else { sendMsg(AppConfig.EVENT.SOCKET.FS_IMAGE_ADD_FAIL, { msg: 'Failed (' + code + ')', -- 2.7.4