Skip to content

Commit 90c4159

Browse files
update
1 parent 15c7e54 commit 90c4159

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/AzureAppConfigurationImpl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ type PagedSettingSelector = SettingSelector & {
5050
};
5151

5252
const DEFAULT_STARTUP_TIMEOUT = 100 * 1000; // 100 seconds in milliseconds
53+
const MAX_STARTUP_TIMEOUT = 60 * 60 * 1000; // 60 minutes in milliseconds
5354

5455
export class AzureAppConfigurationImpl implements AzureAppConfiguration {
5556
/**
@@ -336,7 +337,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
336337
await this.#inspectFmPackage();
337338
const retryEnabled = this.#options?.startupOptions?.retryEnabled ?? false;
338339
const startTimestamp = Date.now();
339-
while (true) {
340+
while (startTimestamp + MAX_STARTUP_TIMEOUT > Date.now()) {
340341
try {
341342
await this.#loadSelectedAndWatchedKeyValues();
342343
if (this.#featureFlagEnabled) {
@@ -361,6 +362,9 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
361362
}
362363
}
363364
}
365+
if (!this.#isInitialLoadCompleted) {
366+
throw new Error("Load operation exceeded the maximum startup timeout limitation.");
367+
}
364368
}
365369
}
366370

0 commit comments

Comments
 (0)