Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation PDF simultaneously fails #190

Open
cod opened this issue Jun 6, 2022 · 3 comments
Open

Creation PDF simultaneously fails #190

cod opened this issue Jun 6, 2022 · 3 comments

Comments

@cod
Copy link

cod commented Jun 6, 2022

Use this library in RabbitMQ consumer app and faced with simultaneous PDF Docs generation problem:

Request for 3 docs producess this:
Doc 1. started
Doc 2. started
Doc 3. started

Doc 3. done successfully
Doc 2. [Nest] 811334 - 06/06/2022, 1:12:07 PM ERROR [RpcExceptionsHandler] ENOENT: no such file or directory, open '/tmp/html-pdf-811334.pdf'
Doc 1. [Nest] 811334 - 06/06/2022, 1:12:07 PM ERROR [RpcExceptionsHandler] ENOENT: no such file or directory, open '/tmp/html-pdf-811334.pdf'

As I understand, this is the problem:
in lib/pdf.default.ts

export const defaultCreateOptions = {
    filename: join(tmpdir(), `html-pdf-${process.pid}.pdf`),
};

Think using random name for each file will solve the problem.

@manueljishi
Copy link

Hello @cod
I'm currently facing the same issue.
Did you manage to solve the problem? If so, how did you do it?
Thank you very much!

@cod
Copy link
Author

cod commented Feb 20, 2023

Hi @manueljishi
Unfortunately, all my tries failed and I've switched to @ricktechs/nestjs-puppeteer

@manueljishi
Copy link

Hi @cod,
that sounds really bad haahaha.
I'll have to start thinking about changing.
Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants