Skip to content

Commit 71d095f

Browse files
committed
remove get socket call
1 parent eab1701 commit 71d095f

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

helpers/exec_helper.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var spawn = require('child_process').spawn,
88
};*/
99

1010
exports.execute_program = function(file, is_job) {
11-
11+
1212
console.log(file);
1313
if (file.extension === 'py') {
1414
execute_program(file, "python", is_job);
@@ -31,7 +31,7 @@ exports.stop_program = function(file, is_job) {
3131

3232
exports.trace_program = function(file, socket) {
3333
var file_path = path.resolve(__dirname + "/../repositories/" + file.path.replace('/filesystem/', ''));
34-
console.log(file_path);
34+
console.log(file_path);
3535
if (file.extension === 'py') {
3636
execute_python_trace(file_path, socket);
3737
} else if (file.extension === 'rb') {
@@ -104,17 +104,15 @@ function execute_program(file, type, is_job) {
104104
console.log('execute_program');
105105
console.log(file_path);
106106

107-
require('../server').get_socket(file.username, function(socket) {
108-
console.log(file);
109-
var cwd = get_cwd(file_path);
110-
var prog = spawn("sudo", [type, file_path], {cwd: cwd});
111-
var key = get_key(file);
112-
spawn_list.push({key: key, prog: prog});
113-
if (socket) {
114-
console.log('found socket, executing');
115-
handle_output(prog, file, is_job, socket);
116-
}
117-
});
107+
console.log(file);
108+
var cwd = get_cwd(file_path);
109+
var prog = spawn("sudo", [type, file_path], {cwd: cwd});
110+
var key = get_key(file);
111+
spawn_list.push({key: key, prog: prog});
112+
if (socket) {
113+
console.log('found socket, executing');
114+
handle_output(prog, file, is_job, socket);
115+
}
118116
}
119117

120118
function handle_output(prog, file, is_job, socket) {
@@ -157,4 +155,4 @@ function handle_output(prog, file, is_job, socket) {
157155
}
158156

159157
});
160-
}
158+
}

0 commit comments

Comments
 (0)