shell: set utf8 encoding explicity for spawn and as the default for sudo

This commit is contained in:
Girish Ramakrishnan
2025-10-13 10:32:08 +02:00
parent 36d443fa36
commit 45d68c4da8
5 changed files with 14 additions and 12 deletions

View File

@@ -691,7 +691,7 @@ async function update(name, memory) {
// 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.spawn('docker', ['update', '--memory', memory, '--memory-swap', '-1', name], {}));
const [error] = await safe(shell.spawn('docker', ['update', '--memory', memory, '--memory-swap', '-1', name], { encoding: 'utf8' }));
if (!error) return;
await timers.setTimeout(60 * 1000);
}