diff --git a/.gitignore b/.gitignore index a9b1a7413..7150accac 100644 --- a/.gitignore +++ b/.gitignore @@ -108,6 +108,7 @@ tools/*.dll # Azure Tooling # node_modules +.ntvs_analysis.dat # Eclipse # *.pydevproject diff --git a/ClientRuntimes/NodeJS/ClientRuntime.Azure/lib/azureServiceClient.js b/ClientRuntimes/NodeJS/ClientRuntime.Azure/lib/azureServiceClient.js index 7b82c2d11..fba17bd70 100644 --- a/ClientRuntimes/NodeJS/ClientRuntime.Azure/lib/azureServiceClient.js +++ b/ClientRuntimes/NodeJS/ClientRuntime.Azure/lib/azureServiceClient.js @@ -17,9 +17,16 @@ var WebResource = msrest.WebResource; * TokenCredentials object used for authentication. * * @param {object} options - The parameter options used by ServiceClient + * + * @param {Array} [options.longRunningOperationRetryTimeoutInSeconds] - Retry timeout + * */ function AzureServiceClient(credentials, options) { AzureServiceClient['super_'].call(this, credentials, options); + if (options) { + this.longRunningOperationRetryTimeoutInSeconds = + options.longRunningOperationRetryTimeoutInSeconds; + } } util.inherits(AzureServiceClient, msrest.ServiceClient); @@ -50,7 +57,7 @@ AzureServiceClient.prototype.getPutOperationResult = function (resultOfInitialRe resultOfInitialRequest.response.statusCode))); } - var pollingState = new PollingState(resultOfInitialRequest, this.longRunningOperationRetryTimeout); + var pollingState = new PollingState(resultOfInitialRequest, this.longRunningOperationRetryTimeoutInSeconds); async.whilst( //while condition @@ -113,14 +120,14 @@ AzureServiceClient.prototype.getPostOrDeleteOperationResult = function (resultOf return callback(new Error('Missing resultOfInitialRequest.response')); } - if (resultOfInitialRequest.response.statusCode != 200 && - resultOfInitialRequest.response.statusCode != 202 && - resultOfInitialRequest.response.statusCode != 204) { + if (resultOfInitialRequest.response.statusCode !== 200 && + resultOfInitialRequest.response.statusCode !== 202 && + resultOfInitialRequest.response.statusCode !== 204) { return callback(new Error(util.format('Unexpected polling status code from long running operation \'%s\'', resultOfInitialRequest.response.statusCode))); } - var pollingState = new PollingState(resultOfInitialRequest, this.longRunningOperationRetryTimeout); + var pollingState = new PollingState(resultOfInitialRequest, this.longRunningOperationRetryTimeoutInSeconds); async.whilst( function () { diff --git a/ClientRuntimes/NodeJS/ClientRuntime.Azure/test/azureServiceClientTests.js b/ClientRuntimes/NodeJS/ClientRuntime.Azure/test/azureServiceClientTests.js index c83dbd90a..d0f038c15 100644 --- a/ClientRuntimes/NodeJS/ClientRuntime.Azure/test/azureServiceClientTests.js +++ b/ClientRuntimes/NodeJS/ClientRuntime.Azure/test/azureServiceClientTests.js @@ -79,9 +79,8 @@ describe('AzureServiceClient', function () { } }; - var client = new AzureServiceClient(); + var client = new AzureServiceClient(null, { longRunningOperationRetryTimeoutInSeconds : 0}); client._getStatus = mockedGetStatus; - client.longRunningOperationRetryTimeout = 0; describe('Put', function () { resultOfInitialRequest.response.statusCode = 201; diff --git a/ClientRuntimes/NodeJS/ClientRuntime/NodeJsClientRuntime.njsproj b/ClientRuntimes/NodeJS/ClientRuntime/NodeJsClientRuntime.njsproj index 915bc0e57..c83178767 100644 --- a/ClientRuntimes/NodeJS/ClientRuntime/NodeJsClientRuntime.njsproj +++ b/ClientRuntimes/NodeJS/ClientRuntime/NodeJsClientRuntime.njsproj @@ -5,7 +5,7 @@ 2.0 {ffccb0e4-74ae-413a-b685-c67cdfb34a11} - ShowAllFiles + ProjectFiles . .