Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions health-check/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const httpService = require('./services/httpService')
* @param {string} [currentServiceName=''] - Optional. Name of the current service to avoid self-check.
* @returns {Promise<Object>} - A formatted response with health check results.
*/
async function healthCheckHandler(config, basicCheck = false, currentServiceName = '') {
async function healthCheckHandler(config, basicCheck = false, currentServiceName = '', serviceVersion) {
validateHealthConfig(config)
const checks = []

Expand Down Expand Up @@ -102,7 +102,7 @@ async function healthCheckHandler(config, basicCheck = false, currentServiceName
checks,
}

return formatResponse(result)
return formatResponse(result,serviceVersion)
}

/**
Expand Down Expand Up @@ -193,10 +193,10 @@ function validateHealthConfig(config) {
* @param {Object} result - The object containing service name, version, healthy status, and checks.
* @returns {Object} - The formatted response object.
*/
function formatResponse(result) {
function formatResponse(result,serviceVersion) {
return {
id: 'service.health.api',
ver: '1.0',
version: serviceVersion,
ts: new Date(),
params: {
resmsgid: uuidv1(),
Expand Down
2 changes: 1 addition & 1 deletion health-check/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elevate-services-health-check",
"version": "0.0.7",
"version": "0.0.8",
"description": "Package that can be used for service health check",
"main": "index.js",
"scripts": {
Expand Down