From 4e755e9fe9e0efa5567fea4d225c709a853c9e3a Mon Sep 17 00:00:00 2001 From: dhuy Date: Mon, 26 May 2014 15:06:31 -0300 Subject: [PATCH] Refactoring the source code of endpoints files --- endpoints/video.js | 7 +++++++ endpoints/video_legenda.js | 6 ++++++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/endpoints/video.js b/endpoints/video.js index a33ef4e..2537b4f 100644 --- a/endpoints/video.js +++ b/endpoints/video.js @@ -42,6 +42,8 @@ function init(req, res) { req.files.video.name + ' 1 ' + parameters.getPosition(req.body.posicao) + ' ' + parameters.getSize(req.body.tamanho) + ' ' + parameters.getTransparency(req.body.transparencia) + ' ' + properties.ID_FROM_BD; + console.log(command_line); + /* Executa a linha de comando */ child = exec(command_line, function(err, stdout, stderr) { // [stdout] = vlibras-core output @@ -63,6 +65,7 @@ function init(req, res) { child.on('error', function(code, signal){ res.send(500, parameters.errorMessage('Erro na chamada ao core')); + properties.ID_FROM_BD++; }); } else { @@ -90,6 +93,8 @@ function init(req, res) { requesting.write(data); requesting.end(); + properties.ID_FROM_BD++; + return; } @@ -144,6 +149,8 @@ function init(req, res) { requesting.write(data); requesting.end(); + + properties.ID_FROM_BD++; }); res.send(200); diff --git a/endpoints/video_legenda.js b/endpoints/video_legenda.js index 92cd1bf..f9ac5fa 100644 --- a/endpoints/video_legenda.js +++ b/endpoints/video_legenda.js @@ -54,6 +54,8 @@ function init(req, res) { ' ' + parameters.getPosition(req.body.posicao) + ' ' + parameters.getSize(req.body.tamanho) + ' ' + parameters.getTransparency(req.body.transparencia) + ' ' + properties.ID_FROM_BD; + console.log(command_line); + /* Executa a linha de comando */ child = exec(command_line, function(err, stdout, stderr) { // [stdout] = vlibras-core output @@ -102,6 +104,8 @@ function init(req, res) { requesting.write(data); requesting.end(); + properties.ID_FROM_BD++; + return; } @@ -156,6 +160,8 @@ function init(req, res) { requesting.write(data); requesting.end(); + + properties.ID_FROM_BD++; }); res.send(200); -- libgit2 0.21.2