Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Commit e8e4dca

Browse files
author
up73k
committed
fix: Prevented EMFILE error (too many open files)
1 parent 1f905cc commit e8e4dca

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/gemini.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const PassthroughEmitter = require('./passthrough-emitter');
77
const Promise = require('bluebird');
88
const q = require('bluebird-q');
99
const pluginsLoader = require('plugins-loader');
10+
const gracefulFs = require('graceful-fs');
1011

1112
const Config = require('./config');
1213
const GeminiError = require('./errors/gemini-error');
@@ -25,6 +26,9 @@ const PREFIX = require('../package').name + '-';
2526
require('http').globalAgent.maxSockets = Infinity;
2627
Promise.promisifyAll(require('fs-extra'));
2728

29+
// patch fs module prototype for preventing EMFILE error (too many open files)
30+
gracefulFs.gracefulify(require('fs'));
31+
2832
const parseBrowsers = (browsers) => {
2933
return browsers && browsers.replace(/\s/g, '').split(',');
3034
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"gemini-configparser": "^0.1.1",
2424
"gemini-core": "^1.0.0",
2525
"gemini-coverage": "^1.0.0",
26+
"graceful-fs": "^4.1.11",
2627
"handlebars": "^4.0.5",
2728
"inherit": "~2.2.1",
2829
"js-yaml": "^3.2.5",

0 commit comments

Comments
 (0)