From 33333305553cd5eb634dfc60a8b43be2146d802d Mon Sep 17 00:00:00 2001 From: roi-codefresh <60569147+roi-codefresh@users.noreply.github.com> Date: Tue, 30 Mar 2021 09:31:53 +0300 Subject: [PATCH] CR-3980 bump task logger, fix memory leak (#69) --- .nvmrc | 2 +- lib/logger.js | 2 +- package.json | 2 +- service.yaml | 2 +- test/logger.unit.spec.js | 2 +- yarn.lock | 31 ++++++++++++++++--------------- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.nvmrc b/.nvmrc index 6af635d..e3653a9 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v11.10.0 +v10.24.0 diff --git a/lib/logger.js b/lib/logger.js index 8bc5dcb..cc06600 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -79,7 +79,7 @@ class Logger { logger.info(`Logging container created for logger id: ${this.loggerId}`); - TaskLogger(this.taskLoggerConfig.task, this.taskLoggerConfig.opts) + TaskLogger(this.taskLoggerConfig.task, { ...this.taskLoggerConfig.opts, updateLogsRate: true }) .then((taskLogger) => { this.taskLogger = taskLogger; taskLogger.on('error', (err) => { diff --git a/package.json b/package.json index 0dcdbbb..9a9833f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "cf-container-logger" ], "dependencies": { - "@codefresh-io/task-logger": "^1.8.13", + "@codefresh-io/task-logger": "^1.8.15", "body-parser": "^1.19.0", "cf-errors": "^0.1.15", "cf-logs": "^1.1.0", diff --git a/service.yaml b/service.yaml index d9dd6c4..ced61b7 100644 --- a/service.yaml +++ b/service.yaml @@ -1 +1 @@ -version: 1.4.6 +version: 1.4.7 diff --git a/test/logger.unit.spec.js b/test/logger.unit.spec.js index e097383..84db3c5 100644 --- a/test/logger.unit.spec.js +++ b/test/logger.unit.spec.js @@ -111,7 +111,7 @@ describe('Logger tests', () => { logger.start(); await Q.delay(10); - expect(TaskLoggerFactory).to.have.been.calledWith(taskLoggerConfig.task, taskLoggerConfig.opts); + expect(TaskLoggerFactory).to.have.been.calledWith(taskLoggerConfig.task, { ...taskLoggerConfig.opts, updateLogsRate: true }); expect(logger._listenForNewContainers).to.have.been.calledOnce; // jshint ignore:line expect(logger._writeNewState).to.have.been.calledOnce; // jshint ignore:line expect(logger._listenForExistingContainers).to.not.have.been.called; // jshint ignore:line diff --git a/yarn.lock b/yarn.lock index 17def45..1f34307 100644 --- a/yarn.lock +++ b/yarn.lock @@ -38,23 +38,22 @@ dependencies: regenerator-runtime "^0.13.4" -"@codefresh-io/task-logger@^1.8.13": - version "1.8.13" - resolved "https://registry.yarnpkg.com/@codefresh-io/task-logger/-/task-logger-1.8.13.tgz#d66795698cd9b3b853376bb1a19048bc54147c01" - integrity sha512-4hxe6qAkM+Q8OlAT4uehJKm5hgzD+Nonu7LUtp7lzcngdlwSnPzjRMnFldHIlY4qaCqQmTr+ZG43PZtCk85qGw== +"@codefresh-io/task-logger@^1.8.15": + version "1.8.15" + resolved "https://registry.yarnpkg.com/@codefresh-io/task-logger/-/task-logger-1.8.15.tgz#a5351f20268b2fcb64f1691d4fe2ead27557dd5c" + integrity sha512-m4RAHGoHuzS3K0vOt09vrGaOhr64CJXxItgQ0T6POnW6zmw7kfR0EV8g6lv65EREYE6hHRgXdIA/Uvvq/KLuAw== dependencies: - cf-errors "^0.1.15" - crypto "0.0.3" + cf-errors "^0.1.16" debug "^4.1.1" firebase "git+https://github.com/codefresh-io/firebase.git#80b2ed883ff281cd67b53bd0f6a0bbd6f330fed5" firebase-token-generator "^2.0.0" jsonwebtoken "^8.4.0" - lodash "4.17.20" + lodash "^4.17.21" mongodb "^3.1.13" node-redis-pubsub "^4.0.0" q "^1.4.1" redis "^2.8.0" - request "2.88.2" + request "^2.88.2" requestretry "^4.1.2" retry "^0.12.0" @@ -758,6 +757,13 @@ cf-errors@^0.1.15: dependencies: lodash "4.17.20" +cf-errors@^0.1.16: + version "0.1.16" + resolved "https://registry.yarnpkg.com/cf-errors/-/cf-errors-0.1.16.tgz#03d0b050ac94762552792907b08bd39d1a012116" + integrity sha512-ewA6cTS+bVC32NCxIdEu/5HQ8zb09PV1ubdu0t2yPXs51K31gI78+XGEomVjaXdTbZcGBPVIWhFnG6R/U7K4IQ== + dependencies: + lodash "^4.17.21" + cf-logs@^1.1.0: version "1.1.22" resolved "https://registry.yarnpkg.com/cf-logs/-/cf-logs-1.1.22.tgz#cc7e6701cb15565cfc74130fe82e92464aa0cf1c" @@ -1096,11 +1102,6 @@ cross-spawn@^7.0.2: shebang-command "^2.0.0" which "^2.0.1" -crypto@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/crypto/-/crypto-0.0.3.tgz#470a81b86be4c5ee17acc8207a1f5315ae20dbb0" - integrity sha1-RwqBuGvkxe4XrMggeh9TFa4g27A= - cycle@1.0.x: version "1.0.3" resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" @@ -3101,7 +3102,7 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4: +lodash@4.17.20, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -4142,7 +4143,7 @@ request-promise@^4.2.6: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@2.88.2, request@^2.88.2: +request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==