diff --git a/util/pythonBridge.js b/util/pythonBridge.js index ff84344..5317f6e 100644 --- a/util/pythonBridge.js +++ b/util/pythonBridge.js @@ -110,6 +110,9 @@ module.exports = { updateStatus(`Starting bridge process; this may take a bit (${currentStep}/${steps})...`) module.exports.bridgeProc = child_process.execFile(bridgepath, { + env: { ...process.env, + PYBRIDGE_HEADER: `true`, + }, maxBuffer: 1024 * 1024 * 1024, // 1GB }); @@ -193,6 +196,7 @@ module.exports = { } module.exports.bridgeProc.stderr.on(`data`, d => parseLog(d, `ERR`)); + module.exports.bridgeProc.stdout.on(`data`, d => parseLog(d, `OUT`)); let existingData = ``; @@ -205,15 +209,18 @@ module.exports = { if(!data.includes(`\n\r`)) { existingData += data; + console.log(`existingData (appended): ${existingData.length}`) return; } else { if(existingData) { data = existingData + data; + console.log(`existingData (reset): ${data.length}`) existingData = ``; - } + } else console.log(`existingData (nothing; no reset): ${data.length}`) const parse = (msg) => { const data = JSON.parse(msg.toString().trim()); + console.log(`bridge data for id ${data.id} (exists: ${module.exports.idHooks.find(h => h.id == data.id) ? `yes` : `no`}): [${data.type}] ${data.content.length}`); if(data.id) { module.exports.idHooks.filter(h => h.id == data.id).forEach(h => h.func(data)); };