UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 0e8e8f59 authored by Douglas Lagemann's avatar Douglas Lagemann
Browse files

Merge branch 'BULL-3251_db_migration' into 'main'

BULL-3251, BULL-3249: Database migration/environment variables

See merge request !5
parents 85fe5576 dd4cbc0f
No related branches found
No related tags found
1 merge request!5BULL-3251, BULL-3249: Database migration/environment variables
......@@ -20,6 +20,31 @@ exports.runMigrations = async () => {
await client.end();
}
/**
* Check connectivity with the database and report results.
*/
exports.healthCheck = async () => {
try {
const client = new Client({
connectionString,
});
await client.connect();
await client.end();
} catch (err) {
console.log(`Database connection error during health check: ${err}`);
return {
status: 500,
message: "Internal Server Error"
};
}
return {
status: 200,
message: "Database connection succeeded. Health check passed."
};
}
/**
* Return the version number stored in the database.
*/
......
......@@ -28,7 +28,7 @@ services:
db:
condition: service_healthy
healthcheck:
test: curl -f http://localhost:$$PORT/health
test: curl -f http://localhost:$$PORT/api/health
timeout: 10s
retries: 5
profiles:
......
......@@ -24,10 +24,6 @@ apiTemplates:
repositoryId: "16614"
formulaFilePath: "formulas/api/golang.yml"
- name: "NewProject DontPickMe"
repositoryId: "16613"
formulaFilePath: "formulas/api/express.yml"
dbTemplates:
- name: "None"
repositoryId: ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment