зеркало из https://github.com/Azure/autorest.git
address CR feedback
This commit is contained in:
Родитель
eaf1630788
Коммит
370821a74d
|
@ -108,6 +108,7 @@ tools/*.dll
|
|||
|
||||
# Azure Tooling #
|
||||
node_modules
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Eclipse #
|
||||
*.pydevproject
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{ffccb0e4-74ae-413a-b685-c67cdfb34a11}</ProjectGuid>
|
||||
<ProjectHome />
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<StartupFile />
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<OutputPath>.</OutputPath>
|
||||
|
|
Загрузка…
Ссылка в новой задаче