feat: idle machine polling
This commit is contained in:
parent
ea36d66167
commit
20727a60cd
7 changed files with 198 additions and 0 deletions
22
test/stress/scripts/index.js
Normal file
22
test/stress/scripts/index.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
const exec = require('child_process')
|
||||
|
||||
/**
|
||||
* Execute simple shell command (async wrapper).
|
||||
* @param {String} cmd
|
||||
* @return {Object} { stdout: String, stderr: String }
|
||||
*/
|
||||
async function execCommand (cmd) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
exec.exec(cmd, (err, stdout, stderr) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
console.log(stdout)
|
||||
console.error(stderr)
|
||||
// resolve({ stdout, stderr })
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { execCommand }
|
||||
Loading…
Add table
Add a link
Reference in a new issue