From 6b39d19d15b1b54db8221d962b7e1fc8ace47ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E7=BA=B8=E5=BF=98=E5=BF=A7?= Date: Tue, 24 Sep 2024 09:42:15 +0800 Subject: [PATCH] feat: try to optimize memory usage --- .github/workflows/ci.yml | 2 +- service/utils.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df1473a8..ac908181 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci +name: CI on: push: diff --git a/service/utils.ts b/service/utils.ts index 1dcfc24c..a9e2a2ce 100644 --- a/service/utils.ts +++ b/service/utils.ts @@ -21,8 +21,15 @@ export const runVlmcs = ({ content: stdout.trim(), status: err ? false : true, }) - vlmcs.kill() }, ) + + vlmcs.on('error', () => { + vlmcs.kill() + }) + + vlmcs.on('close', () => { + vlmcs.kill() + }) }) }