Debugging for #783

This commit is contained in:
Simon Kornblith 2015-07-01 14:45:39 -04:00
parent 7ccc48b4ae
commit 9574de752d

View file

@ -260,11 +260,12 @@ Zotero.IPC = new function() {
instancePipeOpen = true;
}
// Try to write to the pipe once a ms for 100 ms
var timeout = Date.now()+100, wroteToPipe;
// Try to write to the pipe once a ms for 1000 ms
var timeout = Date.now()+1000, wroteToPipe;
do {
wroteToPipe = Zotero.IPC.safePipeWrite(pipe, msg+"\n");
} while(Date.now() < timeout && !wroteToPipe);
if (wroteToPipe) Zotero.debug('IPC: Pipe took '+(Date.now()-(timeout-1000))+' ms to become available');
success = success || wroteToPipe;
defunct = !wroteToPipe;
}