Commit 2e28527911f3495979278eed8bdf4fe362b67bf9

Authored by Renan Soares
1 parent 9c6e68d3
Exists in master and in 1 other branch devel

Corrigido endpoint videornp

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
helpers/core.js
@@ -9,7 +9,7 @@ var kue = require('kue'), @@ -9,7 +9,7 @@ var kue = require('kue'),
9 queue = kue.createQueue(); 9 queue = kue.createQueue();
10 var logger = require('../logsystem/main.js'); 10 var logger = require('../logsystem/main.js');
11 11
12 -function call(id, command_line, req, res) { 12 +function call(id, command_line, req, res, Request, request_object) {
13 /* Executa a linha de comando */ 13 /* Executa a linha de comando */
14 // child = exec(command_line, function(err, stdout, stderr) { 14 // child = exec(command_line, function(err, stdout, stderr) {
15 // // [stdout] = vlibras-core output 15 // // [stdout] = vlibras-core output
@@ -41,9 +41,13 @@ function call(id, command_line, req, res) { @@ -41,9 +41,13 @@ function call(id, command_line, req, res) {
41 // Se o core executou com erro 41 // Se o core executou com erro
42 if (code !== 0) { 42 if (code !== 0) {
43 throw "Erro no retorno do core. Código: " + code; 43 throw "Erro no retorno do core. Código: " + code;
  44 + db.update(Request, request_object.id, 'Error', function (result) {
  45 + });
44 } 46 }
45 47
46 // Se o core executou normal 48 // Se o core executou normal
  49 + db.update(Request, request_object.id, 'Completed', function (result) {
  50 + });
47 res.send(200, { 'response' : 'http://' + properties.SERVER_IP + ':' + properties.port + '/' + id + '.mp4'}); 51 res.send(200, { 'response' : 'http://' + properties.SERVER_IP + ':' + properties.port + '/' + id + '.mp4'});
48 }); 52 });
49 53