From 5958ee23edec7165cae0e79bc96e4a17a941fe47 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 7 Sep 2017 22:33:58 -0700 Subject: [PATCH] Expand stdin buffer size to allow for very large tasks --- app/src/mailsync-process.es6 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/mailsync-process.es6 b/app/src/mailsync-process.es6 index 9a10aaaab..cc14e3b3a 100644 --- a/app/src/mailsync-process.es6 +++ b/app/src/mailsync-process.es6 @@ -112,6 +112,12 @@ export default class MailsyncProcess extends EventEmitter { let buffer = ""; let errBuffer = null; + /* Allow us to buffer up to 1MB on stdin instead of 16k. This is necessary + because some tasks (creating replies to drafts, etc.) can be gigantic amounts + of HTML, many tasks can be created at once, etc, and we don't want to kill + the channel. */ + this._proc.stdin.highWaterMark = 1024 * 1024; + this._proc.stdout.on('data', (data) => { const added = data.toString(); buffer += added;