Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.0.0-beta.2 (Unreleased)

- The RenderingSessionPoller now defaults to a 2s polling interval when waiting for a Standard sized rendering VM. For Premium, 10s is still used.
- Update samples to depend on Azure Identity 2.0.1.

## 1.0.0-beta.1 (2021-09-21)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { PollOperationState, Poller, PollOperation } from "@azure/core-lro";
import { KnownRenderingSessionStatus } from "../generated/models/index";
import { KnownRenderingSessionStatus, KnownRenderingServerSize } from "../generated/models/index";
import { getSessionInternal, endSessionInternal } from "../internal/commonQueries";
import { AbortSignalLike } from "@azure/abort-controller";
import { RemoteRendering } from "../generated/operationsInterfaces";
Expand Down Expand Up @@ -132,7 +132,7 @@ export class RenderingSessionPoller extends Poller<
/**
* Defines how much time the poller is going to wait before making a new request to the service.
*/
public intervalInMs: number = 10000;
public intervalInMs: number;

constructor(
accountId: string,
Expand All @@ -147,7 +147,13 @@ export class RenderingSessionPoller extends Poller<
new RenderingSessionOperationStateImpl(renderingSession)
)
);
this.intervalInMs = options.intervalInMs ? options.intervalInMs : 10000;
if (options.intervalInMs) {
this.intervalInMs = options.intervalInMs;
} else if (renderingSession.size === KnownRenderingServerSize.Standard) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could we add a comment here why this is done? Something like "Standard session startup time is now in the range of x-y s. Because of this we want to poll more frequently in order to detect a ready session with less delay. "

this.intervalInMs = 2000;
} else {
this.intervalInMs = 10000;
}
}

/**
Expand Down