Merge branch 'develop' into integration_airtable

This commit is contained in:
Amit Chauhan
2025-01-30 15:59:40 +05:30
committed by GitHub
44 changed files with 1496 additions and 704 deletions

View File

@@ -18,8 +18,12 @@ import { fork } from 'child_process';
import { capture } from "./utils/analytics";
import swaggerUi from 'swagger-ui-express';
import swaggerSpec from './swagger/config';
import session from 'express-session';
import Run from './models/Run';
const app = express();
app.use(cors({
origin: process.env.PUBLIC_URL ? process.env.PUBLIC_URL : 'http://localhost:5173',
@@ -124,8 +128,23 @@ server.listen(SERVER_PORT, '0.0.0.0', async () => {
}
});
process.on('SIGINT', () => {
process.on('SIGINT', async () => {
console.log('Main app shutting down...');
try {
await Run.update(
{
status: 'failed',
finishedAt: new Date().toLocaleString(),
log: 'Process interrupted during execution - worker shutdown'
},
{
where: { status: 'running' }
}
);
} catch (error: any) {
console.error('Error updating runs:', error);
}
if (!isProduction) {
workerProcess.kill();
}