From 1bcba1f869ee57b994009f11eef5960971558873 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 15 Aug 2018 08:02:03 +1000 Subject: [PATCH 1/3] fix: removed _writev --- src/RollingFileWriteStream.js | 38 ----------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/RollingFileWriteStream.js b/src/RollingFileWriteStream.js index c3b957c..b10655f 100644 --- a/src/RollingFileWriteStream.js +++ b/src/RollingFileWriteStream.js @@ -138,44 +138,6 @@ class RollingFileWriteStream extends Writable { } } - _writev(chunks, callback) { - try { - if (this._dateRollingEnabled() && (this.state.currentDate || moment()).clone() - .add(this.options.intervalDays - 1, 'days') - .isBefore(moment(), 'day') - ) { - this._roll({isNextPeriod: true}); - } - const chunksForOldFile = []; - for (let i = 0; i < chunks.length; i++) { - const c = chunks[i]; - if (this.state.currentSize + c.chunk.length < this.options.maxSize) { - this.state.currentSize += c.chunk.length; - chunksForOldFile.push(c); - } - } - let error; - debug(`writing chunks. file=${this.currentFileStream.path} ` - + `state=${JSON.stringify(this.state)} chunks=${chunksForOldFile}`); - this.currentFileStream.writev(chunksForOldFile, e => error = e); - if (error) { - return callback(error); - } - const chunksForNewFile = _.slice(chunks, chunksForOldFile.length); - if (chunksForNewFile.length > 0) { - this._roll({isNextPeriod: false}); - this.state.currentSize = _.sumBy(chunksForNewFile, c => c.chunk.length); - debug(`writing chunks. file=${this.currentFileStream.path} ` - + `state=${JSON.stringify(this.state)} chunks=${chunksForNewFile}`); - this.currentFileStream.writev(chunksForNewFile, callback); - } else { - callback(); - } - } catch (e) { - return callback(e); - } - } - end(callback) { super.end(); if (this.currentFileStream) { From d7d015283a6f88194495c8ddf88be1e9b3c284fe Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 15 Aug 2018 08:13:16 +1000 Subject: [PATCH 2/3] chore: try to fix build in node 4 --- .babelrc | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index ca0cf69..fda919d 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "plugins": ["lodash"], + "plugins": ["lodash", "transform-object-rest-spread"], "presets": [ ["env", {"targets": {"node": "4"}}] ] diff --git a/package.json b/package.json index 642431e..580f19f 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "babel-cli": "^6.26.0", "babel-core": "^6.26.3", "babel-plugin-lodash": "^3.3.2", + "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.7.0", "cross-env": "^5.1.5", "eslint": "^4.19.1", From 59a9099ee80d96f31b3baddb18ca351d60c8abba Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 15 Aug 2018 08:25:31 +1000 Subject: [PATCH 3/3] fix: removed travis build on node 4 --- .babelrc | 2 +- .travis.yml | 3 +-- package.json | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.babelrc b/.babelrc index fda919d..ca0cf69 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,5 @@ { - "plugins": ["lodash", "transform-object-rest-spread"], + "plugins": ["lodash"], "presets": [ ["env", {"targets": {"node": "4"}}] ] diff --git a/.travis.yml b/.travis.yml index 7723689..19b7cc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js sudo: false node_js: - - "9" + - "10" - "8" - "6" - - "4" diff --git a/package.json b/package.json index 580f19f..642431e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "babel-cli": "^6.26.0", "babel-core": "^6.26.3", "babel-plugin-lodash": "^3.3.2", - "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.7.0", "cross-env": "^5.1.5", "eslint": "^4.19.1",