Skip to content

Commit

Permalink
fix: allow to override endpoint for OperationService
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyJohnes committed Mar 9, 2023
1 parent c8c3af8 commit 20091c9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/operation/wait-for.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ const { operation: { operation_service: { GetOperationRequest } } } = cloudApi;

const DEFAULT_TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes

export const waitForOperation = (op: Operation, session: Session, timeoutMs: number = DEFAULT_TIMEOUT_MS): Promise<Operation> => {
const client = session.client(serviceClients.OperationServiceClient);
export const waitForOperation = (
op: Operation,
session: Session,
timeoutMs: number = DEFAULT_TIMEOUT_MS,
operationServiceEndpoint?: string,
): Promise<Operation> => {
const client = session.client(serviceClients.OperationServiceClient, operationServiceEndpoint);
const maxChecksCount = Math.ceil(timeoutMs / session.pollInterval);

let checksCount = 0;
Expand Down

0 comments on commit 20091c9

Please sign in to comment.