diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 9a8ee8e..8008e67 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -85,12 +85,6 @@ jobs: run: | cd /opt/zhixi/backend && npx prisma generate - - name: Run app directly (5s max, raw output) - run: | - cd /opt/zhixi/backend - timeout 5 node dist/main.js 2>&1 - echo "[EXIT:$?]" - - name: Restart API service run: | sudo systemctl restart zhixi-api diff --git a/src/main.ts b/src/main.ts index 52336c3..ed14af0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -97,19 +97,4 @@ async function bootstrap() { await app.listen(port); console.log(`[API] Server running on http://localhost:${port}`); } -// Startup Crash Diagnostics -process.on('uncaughtException', (err) => { - console.error('[FATAL] Uncaught Exception:', err.message); - console.error(err.stack); - process.exit(1); -}); -process.on('unhandledRejection', (reason) => { - console.error('[FATAL] Unhandled Rejection:', reason); - process.exit(1); -}); - -bootstrap().catch((err) => { - console.error('[FATAL] Bootstrap failed:', err.message); - console.error(err.stack); - process.exit(1); -}); +bootstrap();