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

Not removing the temporary files when using html option #255

Closed
JonWatkins opened this issue Nov 14, 2017 · 3 comments
Closed

Not removing the temporary files when using html option #255

JonWatkins opened this issue Nov 14, 2017 · 3 comments

Comments

@JonWatkins
Copy link

JonWatkins commented Nov 14, 2017

I am trying to run this on an HTML string, But it does not remove any of the temporary files at the end of the process.

My HTML string contains links to css files that are external resources, and it seems to be dealing with this just fine.

critical.generate({
    inline: true,
    html: content,
    width: 1300,
    height: 1300,
    extract: false,
    minify: true
  }).then(function (output) {
    // handle output here
  }).catch(function (ex) {
    // handle error here
  })

The content variable is a rendered pug file. Im using this as part of a publish/cache process in the server. And it is just filling the server up with the temp files (in the root of the application)

Is there a way i can stop this from happening?

Edit:

On stopping the node server the temp files are all removed, and the process exits with a status of 2 and this error ELIFECYCLE.

@JonWatkins
Copy link
Author

Took a while to get back here and close this, but I ended up running it in a child process this lets it do exactly what I needed.

@simon-jouet
Copy link

Hi @JonWatkins,

You closed this issue, but I believe this is still a valid issue and the temporary file should be removed without having to stop node.

@bezoerb
Copy link
Collaborator

bezoerb commented Dec 2, 2017

Just released v1.1.0 which triggers temp file removal after the critical css is computed

/cc @JonWatkins @simon-jouet

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

3 participants