Skip to content

Commit 12be555

Browse files
committed
Fix formatting
1 parent cd087f2 commit 12be555

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

examples/TaskStatusRedis/functions.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@ var spawn = require('child_process').spawn;
33
// Spawns a job "node handler.js" and waits for the notification of its
44
// completion using the Redis task status notification mechanism
55
async function task_status_redis_test(ins, outs, context, cb) {
6-
var n = Number(ins.number.data[0]);
7-
8-
//console.log("Spawning process...");
9-
10-
var proc = spawn('node', ['handler.js', context.taskId, context.redis_url]);
11-
12-
proc.stderr.on('data', function(data) {
13-
console.log(data.toString());
14-
});
15-
16-
proc.stdout.on('data', function(data) {
17-
console.log(data.toString());
18-
});
19-
20-
proc.on('exit', function(code) {
21-
//console.log('Process exited with code', code);
22-
});
23-
24-
// wait for the task to finish (timeout=0 means indefinite)
25-
try {
26-
var taskStatus = await context.taskStatus(0);
27-
console.log('Received task status:', taskStatus);
28-
setTimeout(function() {
29-
cb(null, outs);
30-
}, 5000);
31-
} catch(err) {
32-
console.err(err);
33-
throw err;
34-
}
6+
var n = Number(ins.number.data[0]);
7+
8+
//console.log("Spawning process...");
9+
10+
var proc = spawn('node', ['handler.js', context.taskId, context.redis_url]);
11+
12+
proc.stderr.on('data', function(data) {
13+
console.log(data.toString());
14+
});
15+
16+
proc.stdout.on('data', function(data) {
17+
console.log(data.toString());
18+
});
19+
20+
proc.on('exit', function(code) {
21+
//console.log('Process exited with code', code);
22+
});
23+
24+
// wait for the task to finish (timeout=0 means indefinite)
25+
try {
26+
var taskStatus = await context.taskStatus(0);
27+
console.log('Received task status:', taskStatus);
28+
setTimeout(function() {
29+
cb(null, outs);
30+
}, 5000);
31+
} catch(err) {
32+
console.err(err);
33+
throw err;
34+
}
3535
}
3636

3737
exports.task_status_redis_test = task_status_redis_test;

0 commit comments

Comments
 (0)