Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplifying code.

  • Loading branch information...
commit 42fd6148324b987672b64d0aa1c4d698489630fe 1 parent c504daa
André Rodrigues andrerod authored
11 lib/serviceruntime/roleenvironment.js
View
@@ -423,14 +423,7 @@ RoleEnvironment._processGoalStateChange = function (newGoalState, callback) {
changes.cancel = function () {
changes.cancelled = true;
- var newState = {
- clientId: RoleEnvironment.clientId,
- incarnation: currentGoalState.incarnation,
- status: ServiceRuntimeConstants.RoleStatus.RECYCLE,
- expiration: maxDateTime
- };
-
- RoleEnvironment.runtimeClient.setCurrentState(newState, optionalCallback);
+ RoleEnvironment.requestRecycle(optionalCallback);
}
RoleEnvironment.emit(ServiceRuntimeConstants.CHANGING, changes);
@@ -448,8 +441,6 @@ RoleEnvironment._processGoalStateChange = function (newGoalState, callback) {
optionalCallback();
}
});
- } else {
- optionalCallback();
}
}
} else {
2  test/serviceruntime/roleenvironment-tests.js
View
@@ -1177,7 +1177,9 @@ suite('roleenvironment-tests', function () {
azure.RoleEnvironment.on(ServiceRuntimeConstants.CHANGING, function (changes) {
changes.cancel();
+ });
+ sandbox.stub(azure.RoleEnvironment, 'requestRecycle', function () {
clearInterval(serverGoalStateInterval);
serverVersions.on('close', function () {
Please sign in to comment.
Something went wrong with that request. Please try again.