М
Size: a a a
М
Д
queue = []Можно как-нибудь улучшить? При запросе с командой. из контроллера вызывается scheduler(command)
async function scheduler(command) {
if (queue.length === 0) {
queue.push(command)
while (queue.length !== 0) {
const { stdout, stderr } = await exec(queue[0])
queue.shift()
console.log('command is done ' + `left: ${queue.length}`)
}
} else {
queue.push(command)
}
}
CI
Д
Т
AS
ZM
AS
T
ZM
T
AS
ZM
T
PV
ZM
Т
BB
АП
SN