mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-25 20:16:17 +00:00
fix memory leak by correct listen for errors during build writes
This commit is contained in:
parent
c4c3a73b01
commit
a109eb577c
@ -89,16 +89,17 @@ module.exports = function(app) {
|
||||
}
|
||||
|
||||
var filePath = getBuildLogPath(build.id);
|
||||
writeStreamsHash[filePath] = (
|
||||
writeStreamsHash[filePath] ||
|
||||
fs.createWriteStream(getBuildLogPath(build.id), {encoding: 'utf8'})
|
||||
);
|
||||
|
||||
if (!writeStreamsHash[filePath]) {
|
||||
writeStreamsHash[filePath] = fs.createWriteStream(
|
||||
getBuildLogPath(build.id), {encoding: 'utf8'}
|
||||
);
|
||||
writeStreamsHash[filePath].on('error', function(err) {
|
||||
console.error(err.stack || err);
|
||||
});
|
||||
}
|
||||
// TODO: close ended files
|
||||
writeStreamsHash[filePath]
|
||||
.on('error', function(err) {
|
||||
console.log(err.stack || err);
|
||||
})
|
||||
.write(data);
|
||||
writeStreamsHash[filePath].write(data);
|
||||
|
||||
app.dataio.resource('build' + build.id).clientEmitSync('data', data);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user