This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -22,5 +22,6 @@ module.exports = {
2222 newAuthError : msg => new AppError ( 401 , msg || 'Auth failed.' ) ,
2323 newPermissionError : msg => new AppError ( 403 , msg || 'The entity does not exist.' ) ,
2424 newConflictError : msg => new AppError ( 409 , msg || 'The entity does not exist.' ) ,
25+ serviceUnavailableError : msg => new AppError ( 503 , msg || 'One or more services are not available' ) ,
2526 elasticSearchEnrichError : msg => new AppError ( 500 , msg || 'Elasticsearch enrich failed' )
2627}
Original file line number Diff line number Diff line change 1+ /**
2+ * the role controller
3+ */
4+
5+ const service = require ( './service' )
6+ const helper = require ( '../../common/helper' )
7+ const methods = helper . getControllerMethods ( service )
8+
9+ module . exports = {
10+ ...methods
11+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * the health routes
3+ */
4+
5+ const Controller = require ( './controller' )
6+ module . exports = {
7+ '/health' : {
8+ get : {
9+ method : Controller . get
10+ }
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ const errors = require ( '../../common/errors' )
2+ const models = require ( '../../models' )
3+
4+ async function get ( ) {
5+ // Check QLDB Connection by retrieving a session
6+ try {
7+ const session = await models . DBHelper . getSession ( )
8+
9+ session . close ( )
10+ } catch ( e ) {
11+ throw errors . serviceUnavailableError ( `QLDB is unavailable, ${ e . message } ` )
12+ }
13+
14+ return { checksRun : 1 }
15+ }
16+
17+ module . exports = { get }
You can’t perform that action at this time.
0 commit comments