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

added option disableThreading #7

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##########################################################
#### WhiteSource "Bolt for Github" configuration file ####
##########################################################

# Configuration #
#---------------#
ws.repo.scan=true
vulnerable.check.run.conclusion.level=failure
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ process.on('message', function (message) {
- size (Optional, Defaults to # of CPUs)
- log (Optional, Defaults to false)
- timeout (Optional, Defaults to 30000ms)
- disableThreading (Optional, Defaults to false) Default size will be limited to physical CPUs only if `true`

## Testing

```bash
npm test
```
```
14 changes: 7 additions & 7 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
var _ = require('lodash');
var childProcess = require('child_process');
var generic = require('generic-pool');

var CPU_COUNT = require('physical-cpu-count')
/**
* Constructor
*/
function Pool (path, args, options, settings) {
_.defaults(settings, {
name: 'fork-pool',
size: require('os').cpus().length,
log: false,
timeout: 30000,
debug: false,
debugPort: process.debugPort // Default debugging port for the main process. Skip from here.
name: 'fork-pool',
size: settings.disableThreading ? CPU_COUNT : require('os').cpus().length,
log: false,
timeout: 30000,
debug: false,
debugPort: process.debugPort // Default debugging port for the main process. Skip from here.
});

//
Expand Down
Loading