bauhausjs / phantom-html2pdf

Node module to generate PDFs from HTML via PhantomJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temp files rule not being enforced by options

JamesLouieExp opened this issue · comments

I was trying to validate that framework artifacts where being cleaned properly and I think there may be an issue with cleaning up temporary files.

Following commit 88985e5, the Readme should reflect the name change from 'deleteOnAction' to 'keepTmpFiles'.

Additionally taking a look at the constructor for pdfResult.js, it takes 3 parameters (err, filePath, deleteOnAction), but all usages that I found only use the first two.

To verify that that the temp files existed, I printed out the result.getTmpPath(), called a result.toBuffer() method, and then checked the resulting tmp path folder to see if it existed.

May I miss something, but all I can see is that someone forgot to update the Readme.

Okay, I can see that it is using the 'tmp' node library to remove temp files, but I only notice that it removed the files it from my development machine after I restarted it.

As my plan was to implement a service using to produce pdfs, I am wondering if this would be an issue in production and if the os would be able to manage this tmp folder.

What I thought that option to do is more in line with what is already implemented in the pdfResult.js class where it contains the parameter deleteOnAction, where after retrieving the data, it would delete the temp file in the same flow, leaving no artifacts from the process.

Okey, I don't understand your problem. My test-code doesn't even create temp files unless I don't create them myself.

Could you please show what exactly you did?

Closing because of no reaction.