fix: skip not installed nodes
This commit is contained in:
parent
45173e7c0e
commit
98b98c8ddb
1 changed files with 13 additions and 0 deletions
|
|
@ -22,6 +22,18 @@ function plugin (crypto) {
|
|||
return plugin
|
||||
}
|
||||
|
||||
function isWalletNodeInstalled (status) {
|
||||
// From http://supervisord.org/subprocess.html#process-states
|
||||
switch (status) {
|
||||
case 'STARTING' || 'RUNNING' || 'STOPPED' || 'BACKOFF' || 'STOPPING' || 'EXITED' || 'FATAL':
|
||||
return true
|
||||
case 'UNKNOWN':
|
||||
return false
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function run () {
|
||||
_.forEach((crypto) => {
|
||||
if (!_.includes(crypto.cryptoCode, _.keys(PLUGINS))) return
|
||||
|
|
@ -29,6 +41,7 @@ function run () {
|
|||
const cryptoPlugin = plugin(crypto)
|
||||
const status = common.es(`sudo supervisorctl status ${crypto.code} | awk '{ print $2 }'`).trim()
|
||||
|
||||
if (!isWalletNodeInstalled(status)) return
|
||||
cryptoPlugin.updateCore(common.getBinaries(crypto.cryptoCode), _.includes(status, ['RUNNING', 'STARTING']))
|
||||
}, cryptos)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue