Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await defaultLock.acquire(this.senderLock, () => {
const options: AwaitableSenderOptions = this._createSenderOptions(
Constants.defaultOperationTimeoutInMs,
true
);
// shall retry forever at an interval of 15 seconds if the error is a retryable error
// else bail out when the error is not retryable or the oepration succeeds.
const config: RetryConfig = {
operation: () => this._init(options),
connectionId: this._context.connectionId,
operationType: RetryOperationType.senderLink,
connectionHost: this._context.config.host,
retryOptions: {
maxRetries: Constants.defaultMaxRetriesForConnection,
retryDelayInMs: 15000
}
};
return retry(config);
});