From 4d3f6ee5a774a250236841764016554fc94bc268 Mon Sep 17 00:00:00 2001 From: Futa Arai Date: Thu, 26 Dec 2024 22:40:01 +0900 Subject: [PATCH] only skip puppeteer init on swagger generation --- apps/pdf-converter/src/service/pdf-convert.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/pdf-converter/src/service/pdf-convert.ts b/apps/pdf-converter/src/service/pdf-convert.ts index c9c2cdc0b2a..98b8cf064b6 100644 --- a/apps/pdf-converter/src/service/pdf-convert.ts +++ b/apps/pdf-converter/src/service/pdf-convert.ts @@ -53,8 +53,6 @@ class PdfConvertService implements OnInit { logger: Logger; async $onInit(): Promise { - if (process.env.SWAGGER_GENERATION === 'true') return; - await this.initPuppeteerCluster(); } @@ -253,6 +251,9 @@ class PdfConvertService implements OnInit { * Initialize puppeteer cluster */ private async initPuppeteerCluster(): Promise { + // puppeteer is unnecessary for swagger schema generation + if (process.env.SWAGGER_GENERATION === 'true') return; + this.puppeteerCluster = await Cluster.launch({ concurrency: Cluster.CONCURRENCY_PAGE, maxConcurrency: this.maxConcurrency,