better unsubscribe, startup stagger

This commit is contained in:
Ben Wilson
2023-08-05 09:57:39 -04:00
parent fe677b88f8
commit b2f5cb5806
4 changed files with 19 additions and 16 deletions
+8
View File
@@ -3,6 +3,7 @@ import { NestFactory } from '@nestjs/core';
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import * as bitcoinjs from 'bitcoinjs-lib';
import { useContainer } from 'class-validator';
import { setTimeout } from 'timers/promises';
import * as ecc from 'tiny-secp256k1';
import { AppModule } from './app.module';
@@ -20,6 +21,13 @@ async function bootstrap() {
// };
//const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter({ https: httpsOptions }));
// stagger startup
if (process.env.NODE_APP_INSTANCE != null) {
await setTimeout(parseInt(process.env.NODE_APP_INSTANCE) * 5000);
}
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
app.setGlobalPrefix('api')
app.useGlobalPipes(