Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-12-12 13:34:06 +01:00
parent 29180ec3d4
commit dff4a97067
2 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
'@backstage/backend-defaults': minor
---
**BREAKING CHANGE**: The `LifecycleMiddlewareOptions.startupRequestPauseTimeout` has been removed. Use the `backend.lifecycle.startupRequestPauseTimeout` setting in your `app-config.yaml` file to customize how the `createLifecycleMiddleware` function should behave. Also the root config service is required as an options when calling the `createLifecycleMiddleware` function:
**BREAKING PRODUCERS**: The `LifecycleMiddlewareOptions.startupRequestPauseTimeout` has been removed. Use the `backend.lifecycle.startupRequestPauseTimeout` setting in your `app-config.yaml` file to customize how the `createLifecycleMiddleware` function should behave. Also the root config service is required as an option when calling the `createLifecycleMiddleware` function:
```diff
- createLifecycleMiddleware({ lifecycle, startupRequestPauseTimeout })
@@ -51,7 +51,7 @@ export interface LifecycleMiddlewareOptions {
export function createLifecycleMiddleware(
options: LifecycleMiddlewareOptions,
): RequestHandler {
const { lifecycle } = options;
const { config, lifecycle } = options;
let state: 'init' | 'up' | 'down' = 'init';
const waiting = new Set<{
@@ -82,11 +82,8 @@ export function createLifecycleMiddleware(
let startupRequestPauseTimeout: HumanDuration = DEFAULT_TIMEOUT;
if (
'config' in options &&
options.config.has('backend.lifecycle.startupRequestPauseTimeout')
) {
startupRequestPauseTimeout = readDurationFromConfig(options.config, {
if (config.has('backend.lifecycle.startupRequestPauseTimeout')) {
startupRequestPauseTimeout = readDurationFromConfig(config, {
key: 'backend.lifecycle.startupRequestPauseTimeout',
});
}