General Actions to handlers Refacto
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const SKIP_PRIMORDIAL_SECTIONS = new Set([
|
||||
'maestro',
|
||||
'mysql',
|
||||
'accessRights',
|
||||
'systemMesh',
|
||||
'arenaMesh',
|
||||
])
|
||||
|
||||
export function getPrimordialDaemonIds(config = {}) {
|
||||
const ids = []
|
||||
for(const [section, block] of Object.entries(config)) {
|
||||
if(SKIP_PRIMORDIAL_SECTIONS.has(section)) continue
|
||||
if(!block || typeof(block) !== 'object' || Array.isArray(block)) continue
|
||||
if(!block.primordialDaemon) continue
|
||||
ids.push(typeof(block.senderId) === 'string' ? block.senderId : section)
|
||||
}
|
||||
return(ids)
|
||||
}
|
||||
|
||||
export function buildPrepareQuorum(agentIds, config) {
|
||||
const primordialIds = getPrimordialDaemonIds(config)
|
||||
return([...agentIds, ...primordialIds])
|
||||
}
|
||||
Reference in New Issue
Block a user