shell: remove usage of .spawn
This commit is contained in:
@@ -648,12 +648,10 @@ async function update(name, memory, memorySwap) {
|
||||
assert.strictEqual(typeof memory, 'number');
|
||||
assert.strictEqual(typeof memorySwap, 'number');
|
||||
|
||||
const args = `update --memory ${memory} --memory-swap ${memorySwap} ${name}`.split(' ');
|
||||
// scale back db containers, if possible. this is retried because updating memory constraints can fail
|
||||
// with failed to write to memory.memsw.limit_in_bytes: write /sys/fs/cgroup/memory/docker/xx/memory.memsw.limit_in_bytes: device or resource busy
|
||||
|
||||
for (let times = 0; times < 10; times++) {
|
||||
const [error] = await safe(shell.promises.spawn(`update(${name})`, '/usr/bin/docker', args, { }));
|
||||
const [error] = await safe(shell.promises.exec(`update(${name})`, `docker update --memory ${memory} --memory-swap ${memorySwap} ${name}`, {}));
|
||||
if (!error) return;
|
||||
await timers.setTimeout(60 * 1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user