Fixups
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com> Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -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 })
|
||||
|
||||
+3
-6
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user