From 1fd04e2607bdc62344784b9b466ec77c75665973 Mon Sep 17 00:00:00 2001 From: kicer Date: Thu, 19 Nov 2026 21:34:44 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20core=20=E6=97=A5=E5=BF=97=E8=BD=AE?= =?UTF-8?q?=E8=BD=AC=2020m=C3=975=EF=BC=9Bdevice=20push=20=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=A1=A5=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/server/tools/executor.js | 2 +- docker-compose.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/server/tools/executor.js b/app/server/tools/executor.js index 78499b9..153b787 100644 --- a/app/server/tools/executor.js +++ b/app/server/tools/executor.js @@ -885,7 +885,7 @@ async function toolDevice(ctx, args) { const abs = resolveInTask(ctx.taskDir, local, fsRoot(ctx)); const t0 = Date.now(); 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)}…)`; } catch (e) { log.warn('device', `push ${name} ${remote} 失败:${e.message}`); diff --git a/docker-compose.yml b/docker-compose.yml index e0afc21..897da5f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,12 @@ services: build: ./app container_name: agent-core restart: unless-stopped + # 日志轮转:默认 json-file 无上限,长期跑会把磁盘吃穿。保留最近 100MB。 + logging: + driver: json-file + options: + max-size: "20m" + max-file: "5" ports: # 直接把容器 8090 映射到宿主机端口,用 http://<服务器IP>: 访问。 - "${AGENT_PORT:-8090}:8090"