feat: allow customizing config watch file

Signed-off-by: Antonio Musolino <antoniomusolino007@gmail.com>
This commit is contained in:
Antonio Musolino
2024-03-04 09:48:33 +01:00
parent 80bcb8a84d
commit 9d91128525
3 changed files with 9 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-app-api': patch
---
Add the possibility to disable watching files in the new backend system
+2
View File
@@ -273,6 +273,8 @@ export function readHttpServerOptions(config?: Config): HttpServerOptions;
export interface RootConfigFactoryOptions {
argv?: string[];
remote?: Pick<RemoteConfigSourceOptions, 'reloadInterval'>;
// (undocumented)
watch?: boolean;
}
// @public (undocumented)
@@ -34,6 +34,7 @@ export interface RootConfigFactoryOptions {
* Enables and sets options for remote configuration loading.
*/
remote?: Pick<RemoteConfigSourceOptions, 'reloadInterval'>;
watch?: boolean;
}
/** @public */
@@ -45,6 +46,7 @@ export const rootConfigServiceFactory = createServiceFactory(
const source = ConfigSources.default({
argv: options?.argv,
remote: options?.remote,
watch: options?.watch,
});
console.log(`Loading config from ${source}`);
return await ConfigSources.toConfig(source);