diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-28 13:06:54 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-28 13:06:54 +0200 |
| commit | 2664eb3e474f5d03d1782c15673b774d68fb2c58 (patch) | |
| tree | 1f1e58a6090f6befa75d8f6915388ddee30df04d /app/relay | |
| parent | 3a8d99c5e4f64a9426585943c40635eb183b47ae (diff) | |
textInput/fileUpload
Diffstat (limited to 'app/relay')
| -rw-r--r-- | app/relay/remote.js | 2 | ||||
| -rw-r--r-- | app/relay/runner.js | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/app/relay/remote.js b/app/relay/remote.js index ff2d32b..e468c7d 100644 --- a/app/relay/remote.js +++ b/app/relay/remote.js @@ -26,7 +26,7 @@ remote.on('cmd', (data) => { break default: rpc.invoke('send_command', data.cmd, data.payload || null, (err, res, more) => { - console.log('sent command', res) + console.log('command:', data.cmd, res) remote.emit('res', { cmd: data.cmd, res: res, diff --git a/app/relay/runner.js b/app/relay/runner.js index 906ddbf..ecdfcde 100644 --- a/app/relay/runner.js +++ b/app/relay/runner.js @@ -151,18 +151,17 @@ export function run_task(task, preempt, watch){ } task.uuid = task.uuid || uuidv1() - task.processor = interpreter.gpu ? 'gpu' : 'cpu' + const processor = task.processor = interpreter.gpu ? 'gpu' : 'cpu' remote.emit('task_res', { type: 'task_begin', task }) - if (watch) { - console.log("watching stdout..") - subprocess.stdout.on('data', data => { - remote.emit('task_res', { type: 'stdout', data: data.toString('utf8') }) - }) - subprocess.stderr.on('data', data => { - remote.emit('task_res', { type: 'stderr', data: data.toString('utf8') }) - }) - } + watch && console.log("watching stdout..") + + subprocess.stdout.on('data', data => { + watch && remote.emit('task_res', { type: 'stdout', processor, data: data.toString('utf8') }) + }) + subprocess.stderr.on('data', data => { + watch && remote.emit('task_res', { type: 'stderr', processor, data: data.toString('utf8') }) + }) let finished = false |
