Buckets:
| import {} from '../shared/constants.js'; | |
| import { Application } from './application.js'; | |
| import { logger } from './utils/logger.js'; | |
| import { WebServer } from './web-server.js'; | |
| function attachShutdownHandlers(app) { | |
| let shutdownInProgress = false; | |
| const shutdown = async () => { | |
| logger.info('Shutting down server...'); | |
| shutdownInProgress = true; | |
| try { | |
| await app.stop(); | |
| logger.info('Server shutdown complete'); | |
| } | |
| catch (error) { | |
| logger.error({ error }, 'Error during shutdown'); | |
| process.exit(1); | |
| } | |
| }; | |
| process.once('SIGINT', () => { | |
| void shutdown(); | |
| process.once('SIGINT', () => { | |
| if (shutdownInProgress) { | |
| logger.warn('Force exit requested, terminating immediately...'); | |
| process.exit(1); | |
| } | |
| }); | |
| }); | |
| process.once('SIGTERM', () => { | |
| void shutdown(); | |
| }); | |
| } | |
| export async function runApplication(options) { | |
| const webServer = new WebServer(); | |
| const app = new Application({ | |
| transportType: options.transportType, | |
| webAppPort: options.port, | |
| webServerInstance: webServer, | |
| }); | |
| await app.start(); | |
| attachShutdownHandlers(app); | |
| } | |
| //# sourceMappingURL=run-application.js.map |
Xet Storage Details
- Size:
- 1.31 kB
- Xet hash:
- e8d966199a9dffe7cef0a6ddb049760decafe25ba496ab890b297c78ec086ce4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.