added keepalive to DatabaseManager

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-25 15:27:44 +02:00
parent 6f70113b57
commit c3c90280be
7 changed files with 62 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-common': patch
---
Added a keep-alive refresh loop to the `DatabaseManager`, keeping the connection
pool up.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-common': patch
---
The options part of `DatabaseManager.fromConfig` now accepts an optional logger
field.
+18
View File
@@ -0,0 +1,18 @@
---
'@backstage/create-app': patch
---
The options part of `DatabaseManager.fromConfig` now accepts an optional logger
field. You may want to supply that logger in your backend initialization code to
ensure that you can get relevant logging data when things happen related to the
connection pool.
In `packages/backend/src/index.ts`:
```diff
function makeCreateEnv(config: Config) {
const root = getRootLogger();
...
- const databaseManager = DatabaseManager.fromConfig(config);
+ const databaseManager = DatabaseManager.fromConfig(config, { logger: root });
```