This question already has an answer here:
I want to delay this deletion. I'm wondering if it's possible to wrap an async call within setTimeout(). Or does that not make any sense to do so?
export async function deletePRBucket (options, callback){
try {
return await exec(`some aws cli command to delete a bucket`,
(error, stdout, stderr) => {
console.error(`exec error: ${error}`);
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
callback(error, stdout, stderr)
// process.exit(0)
})
}
catch(err) {
console.log(`there was a problem: ${err}`)
// process.exit(1)
}
}
Note: the exec()
function is async/waited (exec returns a promise after the aws cli call is done processing on the Amazon side). I want to however delay this call a few seconds...
via PositiveGuy
No comments:
Post a Comment