-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement(NOC-1919) add database check on application start up #8
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ment intead of document top
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.5...v1.15.6) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]>
…al postgres instance
task(NOC-1913): moving from "paragraph" terminology to "chunk"
…ypes & cleaned up telnyx context class (#4)
#5) * task(NOC-1914): added describe functionality for all supported file types & cleaned up telnyx context class * fix(NOC-1914): improved describe functionality for JSON/CSV files
…-redirects-1.15.6 build(deps): bump follow-redirects from 1.15.5 to 1.15.6
NOC-1904: Docker Compose
…. Add a check that the environment variables specified all contain values
Tests are added for following endpoints: 1. `/completions` 2. `/state` 3. `/pricing/model` 4. `/pricing/model/cost`
…e unnecearry types + make data as const
feat(NOC-1903): Unit testing and API testing with jest + supertest
…eview - move logic to application.ts
enhancement(NOC-1917) Add a check for the .env file that it's present…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scope
Test database start up behaviour to ensure errors are captured correctly so the end user is aware of potential configuration issues.
Implementation
postgres.ts
contains the constructor for creating the chatbot pool.I've duplicated this code in
application.ts
and created two new functions calledsetupDatabaseConnection
andensureDatabaseConnection
.These two functions are used at application startup to check that you can connect to the database
ai_chatbot
correctly and console logged to the terminal.If I mistakenly use the wrong port, user, database, host or password, you will see the error console logged.
Example
I believe it to be necessary to ensure checks are done on database connectivity but I would appreciate confirmation on whether duplicating the code was the incorrect choice here or if you have preferred suggestions.