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

Limit number of haml processes run together #34

Open
nikhilvij opened this issue Jan 27, 2015 · 3 comments
Open

Limit number of haml processes run together #34

nikhilvij opened this issue Jan 27, 2015 · 3 comments

Comments

@nikhilvij
Copy link

Currently this plugin issues command to run haml commands corresponding to all haml files at once. This causes my server to crash when I run grunt-haml while deploying.

At one point I noted that there were more than 60 simultaneous haml processes.

It would be good, if we could run these processes sequentially or cap the number of processes being run simultaneously.

PS: I am using haml gem, i.e. ruby haml.

@nikhilvij
Copy link
Author

Looked around a bit, and found that there is an async plugin in grunt, which has functions like series which can be used instead of
async.forEach(this.files, function(file, callback) {...
on line 55

@mehcode
Copy link
Contributor

mehcode commented Jan 27, 2015

https://github.com/caolan/async#eachlimitarr-limit-iterator-callback

async.eachLimit

Seems like what we want here. Maybe set the limit to a default of require('os').cpus().length * 2 with some option to override it.


Thank you for submitting this. I'll put this on my list to look at it but if you'd like to submit a pull request it'll likely get done much faster.

@nikhilvij
Copy link
Author

thanks for that default suggestion. Slightly new to grunt so didn't know we could access number of cores.
Will submit a PR. Although I am new to grunt, so might not be written well.

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