From 2e28527911f3495979278eed8bdf4fe362b67bf9 Mon Sep 17 00:00:00 2001 From: Renan Soares Date: Mon, 21 Sep 2015 14:14:26 -0300 Subject: [PATCH] Corrigido endpoint videornp --- helpers/core.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpers/core.js b/helpers/core.js index 2718098..bf771b5 100644 --- a/helpers/core.js +++ b/helpers/core.js @@ -9,7 +9,7 @@ var kue = require('kue'), queue = kue.createQueue(); var logger = require('../logsystem/main.js'); -function call(id, command_line, req, res) { +function call(id, command_line, req, res, Request, request_object) { /* Executa a linha de comando */ // child = exec(command_line, function(err, stdout, stderr) { // // [stdout] = vlibras-core output @@ -41,9 +41,13 @@ function call(id, command_line, req, res) { // Se o core executou com erro if (code !== 0) { throw "Erro no retorno do core. Código: " + code; + db.update(Request, request_object.id, 'Error', function (result) { + }); } // Se o core executou normal + db.update(Request, request_object.id, 'Completed', function (result) { + }); res.send(200, { 'response' : 'http://' + properties.SERVER_IP + ':' + properties.port + '/' + id + '.mp4'}); }); -- libgit2 0.21.2