Skip to content
Closed
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Generally speaking, the following commands are roughly equivalent:
| NPM command | Rush command | Rush command effect |
| ------------------------------------ | ------------------------------------ | ---------------------------------------------------------------- |
| `npm install` | `rush update` | Install dependencies for all projects in the Rush workspace |
| `npm install --save[-dev] <package>` | `rush add -p <package> [--dev]` | Add or update a dependency in the current project |
| `npm install --save[-dev] <package>` | `rush add -p <package> --caret [--dev]` | Add or update a dependency in the current project |
| `npm build` | `rush [re]build` | Build all projects in the Rush workspace |
| | `rush [re]build -t <package>` | Build named project and any projects it depends on |
| | `rushx build` | Build the current project only |
Expand Down
120 changes: 36 additions & 84 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions sdk/core/core-amqp/src/ConnectionContextBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ export interface CreateConnectionContextBaseParameters {
*/
isEntityPathRequired?: boolean;
/**
* @property {number} [operationTimeoutInSeconds] - The duration in which the promise should
* @property {number} [operationTimeoutInMs] - The duration in which the promise should
* complete (resolve/reject). If it is not completed, then the Promise will be rejected after
* timeout occurs. Default: `60 seconds`.
* timeout occurs. Default: `60000 milliseconds`.
*/
operationTimeoutInSeconds?: number;
operationTimeoutInMs?: number;
}

export module ConnectionContextBase {
Expand Down Expand Up @@ -156,7 +156,9 @@ export module ConnectionContextBase {
platform: `(${os.arch()}-${os.type()}-${os.release()})`,
framework: `Node/${process.version}`
},
operationTimeoutInSeconds: parameters.operationTimeoutInSeconds
operationTimeoutInSeconds: parameters.operationTimeoutInMs
? parameters.operationTimeoutInMs / 1000
: undefined
};

if (
Expand Down
22 changes: 10 additions & 12 deletions sdk/core/core-amqp/src/requestResponseLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export interface SendRequestOptions {
*/
abortSignal?: AbortSignalLike;
/**
* @property {number} [timeoutInSeconds] Max time to wait for the operation to complete.
* Default: `60 seconds`.
* @property {number} [timeoutInMs] Max time to wait for the operation to complete.
* Default: `60000 milliseconds`.
*/
timeoutInSeconds?: number;
timeoutInMs?: number;
/**
* @property {string} [requestName] Name of the request being performed.
*/
Expand Down Expand Up @@ -74,20 +74,18 @@ export class RequestResponseLink implements ReqResLink {

/**
* Sends the given request message and returns the received response. If the operation is not
* completed in the provided timeout in seconds `default: 60`, then `OperationTimeoutError` is thrown.
* completed in the provided timeout in milliseconds `default: 60000`, then `OperationTimeoutError` is thrown.
*
* @param {Message} request The AMQP (request) message.
* @param {SendRequestOptions} [options] Options that can be provided while sending a request.
* @returns {Promise<Message>} Promise<Message> The AMQP (response) message.
*/
sendRequest(request: AmqpMessage, options?: SendRequestOptions): Promise<AmqpMessage> {
if (!options) options = {};

if (!options.timeoutInSeconds) {
options.timeoutInSeconds = Constants.defaultOperationTimeoutInSeconds;
sendRequest(request: AmqpMessage, options: SendRequestOptions = {}): Promise<AmqpMessage> {
if (!options.timeoutInMs) {
options.timeoutInMs = Constants.defaultOperationTimeoutInMs;
}

const aborter: AbortSignalLike | undefined = options && options.abortSignal;
const aborter: AbortSignalLike | undefined = options.abortSignal;

return new Promise<AmqpMessage>((resolve: any, reject: any) => {
let waitTimer: any;
Expand All @@ -100,7 +98,7 @@ export class RequestResponseLink implements ReqResLink {

const rejectOnAbort = () => {
const address = this.receiver.address || "address";
const requestName = options!.requestName;
const requestName = options.requestName;
const desc: string =
`[${this.connection.id}] The request "${requestName}" ` +
`to "${address}" has been cancelled by the user.`;
Expand Down Expand Up @@ -212,7 +210,7 @@ export class RequestResponseLink implements ReqResLink {
return reject(translate(e));
};

waitTimer = setTimeout(actionAfterTimeout, options!.timeoutInSeconds! * 1000);
waitTimer = setTimeout(actionAfterTimeout, options.timeoutInMs);
this.receiver.on(ReceiverEvents.message, messageCallback);

log.reqres(
Expand Down
Loading