@@ -8,7 +8,7 @@ var spawn = require('child_process').spawn,
8
8
};*/
9
9
10
10
exports . execute_program = function ( file , is_job ) {
11
-
11
+
12
12
console . log ( file ) ;
13
13
if ( file . extension === 'py' ) {
14
14
execute_program ( file , "python" , is_job ) ;
@@ -31,7 +31,7 @@ exports.stop_program = function(file, is_job) {
31
31
32
32
exports . trace_program = function ( file , socket ) {
33
33
var file_path = path . resolve ( __dirname + "/../repositories/" + file . path . replace ( '/filesystem/' , '' ) ) ;
34
- console . log ( file_path ) ;
34
+ console . log ( file_path ) ;
35
35
if ( file . extension === 'py' ) {
36
36
execute_python_trace ( file_path , socket ) ;
37
37
} else if ( file . extension === 'rb' ) {
@@ -104,17 +104,15 @@ function execute_program(file, type, is_job) {
104
104
console . log ( 'execute_program' ) ;
105
105
console . log ( file_path ) ;
106
106
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
+ }
118
116
}
119
117
120
118
function handle_output ( prog , file , is_job , socket ) {
@@ -157,4 +155,4 @@ function handle_output(prog, file, is_job, socket) {
157
155
}
158
156
159
157
} ) ;
160
- }
158
+ }
0 commit comments