diff --git a/chainWorker.js b/chainWorker.js index b128c87..b1f546b 100644 --- a/chainWorker.js +++ b/chainWorker.js @@ -51,7 +51,9 @@ async function queueChainCheck(client, registry, monitor) { (async () => { const client = await redisClient(); - const chainRepo = Repository(client, chainUrl, chainBranch, { path: chainPath, exclude: ['_template'], require: 'chain.json' }) + const chainRepo = Repository(client, chainUrl, chainBranch, { path: chainPath, exclude: ['_template'], require: 'chain.json', filter: (chain) => { + return chain.chain.status !== 'killed'; + }}) const validatorRepo = Repository(client, validatorUrl, validatorBranch, { require: 'chains.json', storeMeta: async (name, allData) => { await client.json.set([name, 'addresses'].join(':'), '$', allData.reduce((sum, validator) => { for(const chain of validator.chains.chains){ diff --git a/repository/repository.js b/repository/repository.js index a73ccde..0a6c96d 100644 --- a/repository/repository.js +++ b/repository/repository.js @@ -85,6 +85,11 @@ function Repository(client, url, branch, opts) { const data = buildData(dir); + if(opts.filter && !opts.filter(data)){ + await client.del([name, dir].join(':')) + return + } + await client.json.set([name, dir].join(':'), '$', data) return data @@ -96,7 +101,7 @@ function Repository(client, url, branch, opts) { const commit = await latestCommit() await client.json.set([name, 'commit'].join(':'), '$', commit) - + await client.json.set([name, 'repository'].join(':'), '$', { name, url, @@ -109,4 +114,4 @@ function Repository(client, url, branch, opts) { } } -export default Repository \ No newline at end of file +export default Repository