Skip to content

Commit

Permalink
Merge pull request #9528 from weseek/imprv/159235-159690-only-skip-pu…
Browse files Browse the repository at this point in the history
…ppeteer-init-on-swagger-gen

only skip puppeteer init on swagger generation
  • Loading branch information
yuki-takei authored Dec 27, 2024
2 parents edea8be + 4d3f6ee commit be9189f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/pdf-converter/src/service/pdf-convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ class PdfConvertService implements OnInit {
logger: Logger;

async $onInit(): Promise<void> {
if (process.env.SWAGGER_GENERATION === 'true') return;

await this.initPuppeteerCluster();
}

Expand Down Expand Up @@ -253,6 +251,9 @@ class PdfConvertService implements OnInit {
* Initialize puppeteer cluster
*/
private async initPuppeteerCluster(): Promise<void> {
// 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,
Expand Down

0 comments on commit be9189f

Please sign in to comment.