Skip to content

Commit

Permalink
Fix composition step logger (#44)
Browse files Browse the repository at this point in the history
* fixed composition step logger
  • Loading branch information
roi-codefresh authored May 6, 2020
1 parent c9dfe09 commit 21a5511
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
22 changes: 12 additions & 10 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,18 @@ class Logger {
logger.error(err.stack);
});
taskLogger.startHealthCheck();
taskLogger.onHealthCheckReported((status) => {
if (status.status === 'failed') {
this.state.failedHealthChecks.push(status);
this.state.status = 'failed';
}else {
this.state.healthCheckStatus = status;
}

this._writeNewState();
});
if (taskLogger.onHealthCheckReported) {
taskLogger.onHealthCheckReported((status) => {
if (status.status === 'failed') {
this.state.failedHealthChecks.push(status);
this.state.status = 'failed';
}else {
this.state.healthCheckStatus = status;
}

this._writeNewState();
});
}
taskLogger.on('flush', () => {
this._updateMissingLogs();
this._updateLastLoggingDate();
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.7.0",
"@codefresh-io/task-logger": "1.7.1",
"body-parser": "^1.19.0",
"cf-errors": "^0.1.11",
"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.0
version: 1.4.1
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@codefresh-io/task-logger@1.7.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@codefresh-io/task-logger/-/task-logger-1.7.0.tgz#61ff6f494718c2609312627f396d0e497b9065c2"
integrity sha512-ITokP1p7OuRAmDn7MDj/KgHp68ser3R74hBAbUWcQVD3AToV07KSYl8iBQOQbCHsye+UVYzn4GzNF/Lmsri9VA==
"@codefresh-io/task-logger@1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@codefresh-io/task-logger/-/task-logger-1.7.1.tgz#356a728794f4063d7af2664ba72b32348d5f9a44"
integrity sha512-QigacjVXAGnryT7WOK+DjcgMI1jxQjg37qfZqzAsQbFLNyQRiWZY4kC/kv0UZd9F/4mj2Hg/LNCzGJNOaQc3SQ==
dependencies:
cf-errors "^0.1.11"
crypto "0.0.3"
Expand Down

0 comments on commit 21a5511

Please sign in to comment.