metro-bundler: writeFile: limit concurrency

Reviewed By: cpojer

Differential Revision: D5975830

fbshipit-source-id: c35be29e8dd64d9653cd24814c5d9f1ef89755dd
This commit is contained in:
Jean Lauliac 2017-10-05 03:06:48 -07:00 committed by Facebook Github Bot
parent 6d0c371d65
commit e235f6a9fd
1 changed files with 2 additions and 1 deletions

View File

@ -12,9 +12,10 @@
const denodeify = require('denodeify');
const fs = require('fs');
const throat = require('throat');
type WriteFn =
(file: string, data: string | Buffer, encoding?: ?string) => Promise<mixed>;
const writeFile: WriteFn = denodeify(fs.writeFile);
const writeFile: WriteFn = throat(128, denodeify(fs.writeFile));
module.exports = writeFile;