Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Simplifying code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Rodrigues committed Aug 6, 2012
1 parent c504daa commit 42fd614
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 1 addition & 10 deletions lib/serviceruntime/roleenvironment.js
Expand Up @@ -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);
Expand All @@ -448,8 +441,6 @@ RoleEnvironment._processGoalStateChange = function (newGoalState, callback) {
optionalCallback();
}
});
} else {
optionalCallback();
}
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions test/serviceruntime/roleenvironment-tests.js
Expand Up @@ -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 () {
Expand Down

0 comments on commit 42fd614

Please sign in to comment.