Skip to content

Commit

Permalink
Set maxBuffer to avoid ENOBUFS error message
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanie committed Jul 1, 2020
1 parent a95edb5 commit d7efa18
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const semver = require("semver");
const LoadingStrategy = require("./LoadingStrategy");
const VersionRange = require("./VersionRange");

// Set a sensible limit for maxBuffer
// See https://github.com/nodejs/node/pull/23027
const maxBuffer = 1024 * 1024 * 10;

class Docker extends LoadingStrategy {
async load() {
const versionString = await this.validateAndGetSolcVersion();
Expand All @@ -16,7 +20,7 @@ class Docker extends LoadingStrategy {

try {
return {
compile: options => String(execSync(command, { input: options })),
compile: options => String(execSync(command, { input: options, maxBuffer })),
version: () => versionString
};
} catch (error) {
Expand Down

0 comments on commit d7efa18

Please sign in to comment.