Skip to content

Commit

Permalink
CR-3980 bump task logger, fix memory leak (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
roi-codefresh authored Mar 30, 2021
1 parent 20dd723 commit 3333330
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v11.10.0
v10.24.0
2 changes: 1 addition & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion service.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 1.4.6
version: 1.4.7
2 changes: 1 addition & 1 deletion test/logger.unit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 16 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -1096,11 +1102,6 @@ cross-spawn@^7.0.2:
shebang-command "^2.0.0"
which "^2.0.1"

[email protected]:
version "0.0.3"
resolved "https://registry.yarnpkg.com/crypto/-/crypto-0.0.3.tgz#470a81b86be4c5ee17acc8207a1f5315ae20dbb0"
integrity sha1-RwqBuGvkxe4XrMggeh9TFa4g27A=

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"
Expand Down Expand Up @@ -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=

[email protected], lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4:
[email protected], 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==
Expand Down Expand Up @@ -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==
Expand Down

0 comments on commit 3333330

Please sign in to comment.