Commit | Line | Data |
---|---|---|
1 | module.exports = function (data) { | |
2 | if (data.taskType === 'CPU_INTENSIVE') { | |
3 | // CPU intensive task | |
4 | for (let i = 0; i <= 5000; i++) { | |
5 | const o = { | |
6 | a: i | |
7 | } | |
8 | JSON.stringify(o) | |
9 | } | |
10 | return { ok: 1 } | |
11 | } else { | |
12 | throw new Error('Please specify the task type') | |
13 | } | |
14 | } |