Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(() => pm2.describeAsync(serviceId))
.then(([description]) => description.pm2_env.status === 'online')
function check () {
pm2.describeAsync(serviceId)
.then(([description]) => {
if (description.pm2_env.status === 'stopped') {
resolve()
} else {
setTimeout(check, 100)
}
})
.catch(reject)
}