mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-20 03:05:39 +00:00
Moved constants
This commit is contained in:
parent
f41de718a0
commit
9e8793d1b1
@ -437,8 +437,3 @@ export class TerminalQueryParams {
|
||||
public static readonly SubscriptionId = "subscriptionId";
|
||||
public static readonly TerminalEndpoint = "terminalEndpoint";
|
||||
}
|
||||
|
||||
export class LoadOfferRetry {
|
||||
public static readonly MaxRetries = 5;
|
||||
public static readonly RetryAfterMilliSeconds = 5000;
|
||||
}
|
||||
|
@ -41,8 +41,11 @@ import { userContext } from "../../UserContext";
|
||||
import TabsBase from "../Tabs/TabsBase";
|
||||
import { fetchPortalNotifications } from "../../Common/PortalNotifications";
|
||||
import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils";
|
||||
import promiseRetry from "p-retry";
|
||||
|
||||
export default class Collection implements ViewModels.Collection {
|
||||
private static readonly LoadOfferMaxRetries = 5;
|
||||
private static readonly LoadOfferRetryAfterMilliSeconds = 5000;
|
||||
public nodeKind: string;
|
||||
public container: Explorer;
|
||||
public self: string;
|
||||
@ -1333,11 +1336,11 @@ export default class Collection implements ViewModels.Collection {
|
||||
|
||||
public async loadAutopilotOfferWithRetry(): Promise<DataModels.Offer> {
|
||||
let retryCount = 0;
|
||||
while (retryCount < Constants.LoadOfferRetry.MaxRetries) {
|
||||
while (retryCount < Collection.LoadOfferMaxRetries) {
|
||||
if (this.offer().content.offerAutopilotSettings) {
|
||||
return this.offer();
|
||||
} else {
|
||||
await new Promise(resolve => setTimeout(resolve, Constants.LoadOfferRetry.RetryAfterMilliSeconds));
|
||||
await new Promise(resolve => setTimeout(resolve, Collection.LoadOfferRetryAfterMilliSeconds));
|
||||
await this.loadOffer();
|
||||
}
|
||||
retryCount++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user