From 4dcfe89575bd2bedbd34228020e3f7f9dfdf38b9 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Fri, 21 Apr 2023 15:48:13 +0800 Subject: [PATCH] feat: add health checker for slb (#445) closes https://github.com/cnpm/cnpmcore/issues/444 --- .github/workflows/nodejs.yml | 4 ++-- config/plugin.ts | 4 ++++ package.json | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 09b784c0..1bb56d14 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16, 18] + node-version: [16, 18, 20] os: [ubuntu-latest] steps: @@ -83,7 +83,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16, 18] + node-version: [16, 18, 20] os: [ubuntu-latest] steps: diff --git a/config/plugin.ts b/config/plugin.ts index d07ac082..f464ffbf 100644 --- a/config/plugin.ts +++ b/config/plugin.ts @@ -52,6 +52,10 @@ const plugin: EggPlugin = { enable: true, package: 'egg-cors', }, + status: { + enable: true, + package: 'egg-status', + }, }; export default plugin; diff --git a/package.json b/package.json index e4634bcf..40a530be 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "tsc": "npm run clean && tsc -p ./tsconfig.json", "tsc:prod": "npm run clean && tsc -p ./tsconfig.prod.json", "prepublishOnly": "npm run tsc:prod", - "start": "eggctl start --daemon", - "stop": "eggctl stop" + "start": "eggctl start --daemon && touch egg.status", + "stop": "rm -f egg.status && sleep 15 && eggctl stop" }, "repository": { "type": "git", @@ -88,6 +88,7 @@ "egg-errors": "^2.3.0", "egg-redis": "^2.4.0", "egg-scripts": "^2.15.2", + "egg-status": "^1.0.0", "egg-tracer": "^1.1.0", "egg-typebox-validate": "^2.0.0", "egg-view-nunjucks": "^2.3.0",