3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

debug: add clinic.js for debugging

This commit is contained in:
Dragory 2023-04-04 20:44:13 +03:00
parent fcf30fbc00
commit acdde9b3d7
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
6 changed files with 9583 additions and 269 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.clinic
# Runtime data
pids

9824
backend/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -8,10 +8,14 @@
"watch-yaml-parse-test": "cross-env NODE_ENV=development tsc-watch --onSuccess \"node dist/backend/src/yamlParseTest.js\"",
"build": "rimraf dist && tsc",
"start-bot-dev": "cross-env NODE_ENV=development node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/backend/src/index.js",
"start-bot-dev-debug": "NODE_ENV=development clinic heapprofiler --collect-only -- node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9229 dist/backend/src/index.js",
"start-bot-prod": "cross-env NODE_ENV=production node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 dist/backend/src/index.js",
"start-bot-prod-debug": "NODE_ENV=production clinic heapprofiler --collect-only -- node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 dist/backend/src/index.js",
"watch-bot": "cross-env NODE_ENV=development tsc-watch --onSuccess \"npm run start-bot-dev\"",
"start-api-dev": "cross-env NODE_ENV=development node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/backend/src/api/index.js",
"start-api-dev-debug": "NODE_ENV=development clinic heapprofiler --collect-only -- node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 --inspect=0.0.0.0:9239 dist/backend/src/api/index.js",
"start-api-prod": "cross-env NODE_ENV=production node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 dist/backend/src/api/index.js",
"start-api-prod-debug": "NODE_ENV=production clinic heapprofiler --collect-only -- node -r ./register-tsconfig-paths.js --unhandled-rejections=strict --enable-source-maps --stack-trace-limit=30 dist/backend/src/api/index.js",
"watch-api": "cross-env NODE_ENV=development tsc-watch --onSuccess \"npm run start-api-dev\"",
"typeorm": "node -r ./register-tsconfig-paths.js ./node_modules/typeorm/cli.js",
"migrate-prod": "cross-env NODE_ENV=production npm run typeorm -- migration:run",
@ -25,6 +29,7 @@
"dependencies": {
"@silvia-odwyer/photon-node": "^0.3.1",
"bufferutil": "^4.0.3",
"clinic": "^12.1.0",
"cors": "^2.8.5",
"cross-env": "^5.2.0",
"deep-diff": "^1.0.2",

View file

@ -55,6 +55,8 @@ services:
- prepare_backend
volumes:
- ./:/zeppelin
environment:
DEBUG: ${DEBUG-}
command: ["/bin/bash", "/zeppelin/docker/production/start-api.sh"]
bot:
@ -68,6 +70,8 @@ services:
- prepare_backend
volumes:
- ./:/zeppelin
environment:
DEBUG: ${DEBUG-}
command: ["/bin/bash", "/zeppelin/docker/production/start-bot.sh"]
build_dashboard:

View file

@ -8,6 +8,11 @@
echo "Waiting for prepare_backend to finish before starting the API..."
while ping -c1 prepare_backend &>/dev/null; do sleep 1; done;
echo "Starting the API"
cd /zeppelin/backend
exec npm run start-api-prod
if [ -n "$DEBUG" ]; then
echo "Starting API in debug mode"
exec npm run start-api-prod-debug
else
echo "Starting API"
exec npm run start-api-prod
fi

View file

@ -8,6 +8,11 @@
echo "Waiting for prepare_backend to finish before starting the bot..."
while ping -c1 prepare_backend &>/dev/null; do sleep 1; done;
echo "Starting the bot"
cd /zeppelin/backend
exec npm run start-bot-prod
if [ -n "$DEBUG" ]; then
echo "Starting bot in debug mode"
exec npm run start-bot-prod-debug
else
echo "Starting bot"
exec npm run start-bot-prod
fi