Merge pull request #13354 from backstage/freben/keepalive

added keepalive to DatabaseManager
This commit is contained in:
Fredrik Adelöw
2022-08-30 13:00:56 +02:00
committed by GitHub
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 });
```