chore: core 日志轮转 20m×5;device push 日志补本地文件名
This commit is contained in:
@@ -885,7 +885,7 @@ async function toolDevice(ctx, args) {
|
|||||||
const abs = resolveInTask(ctx.taskDir, local, fsRoot(ctx));
|
const abs = resolveInTask(ctx.taskDir, local, fsRoot(ctx));
|
||||||
const t0 = Date.now();
|
const t0 = Date.now();
|
||||||
const r = await devices.push({ device: name, localPath: abs, remotePath: remote });
|
const r = await devices.push({ device: name, localPath: abs, remotePath: remote });
|
||||||
log.info('device', `push ${name} ${remote} ${devBytes(r.bytes)} ${Date.now() - t0}ms`);
|
log.info('device', `push ${name} ${remote} ← ${path.relative(ctx.taskDir, abs) || path.basename(abs)} ${devBytes(r.bytes)} ${Date.now() - t0}ms`);
|
||||||
return `已推到 ${name}:${remote}(${r.bytes} 字节,sha256 ${r.sha256.slice(0, 16)}…)`;
|
return `已推到 ${name}:${remote}(${r.bytes} 字节,sha256 ${r.sha256.slice(0, 16)}…)`;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.warn('device', `push ${name} ${remote} 失败:${e.message}`);
|
log.warn('device', `push ${name} ${remote} 失败:${e.message}`);
|
||||||
|
|||||||
@@ -3,6 +3,12 @@ services:
|
|||||||
build: ./app
|
build: ./app
|
||||||
container_name: agent-core
|
container_name: agent-core
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
# 日志轮转:默认 json-file 无上限,长期跑会把磁盘吃穿。保留最近 100MB。
|
||||||
|
logging:
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "20m"
|
||||||
|
max-file: "5"
|
||||||
ports:
|
ports:
|
||||||
# 直接把容器 8090 映射到宿主机端口,用 http://<服务器IP>:<AGENT_PORT> 访问。
|
# 直接把容器 8090 映射到宿主机端口,用 http://<服务器IP>:<AGENT_PORT> 访问。
|
||||||
- "${AGENT_PORT:-8090}:8090"
|
- "${AGENT_PORT:-8090}:8090"
|
||||||
|
|||||||
Reference in New Issue
Block a user