bauhausjs / phantom-html2pdf

Node module to generate PDFs from HTML via PhantomJS
MIT License
112 stars 47 forks source link

Temp files rule not being enforced by options #42

Closed JamesLouieExp closed 7 years ago

JamesLouieExp commented 7 years ago

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 88985e53096eaa05d46f57fed1e63e69768876a8, 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.

dustin-H commented 7 years ago

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

JamesLouieExp commented 7 years ago

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.

dustin-H commented 7 years ago

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?

dustin-H commented 7 years ago

Closing because of no reaction.