Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Machine endDate is correctly check when sessionDuration is finished. #341

Merged

Conversation

corentindrouet
Copy link
Contributor

When closing a vdi, we set the endDate of the machine, a timeout is starting, and _shouldTerminateMachine is called, but this function is called with the current machine, not with the machine where the end date is updated and we received the machine without the endate.
So we search the machine to know the current endate.

…endate,

or with the last endate.
So we search the machine to know the current endate.
@@ -508,20 +508,21 @@ function updateMachinesPool() {
function _shouldTerminateMachine(machine) {
Promise.props({
isActive: machine.isSessionActive(),
config: ConfigService.get('neverTerminateMachine')
config: ConfigService.get('neverTerminateMachine'),
machineToTerminate: Machine.findOne({id: machine.id})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

machine and Machine.findOne(machine) are strictly the same. How is this fixing something ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, machine is the not updated machine, if you reopen/reclose the vdi, the machine you received is not updated with the right endDate. Search the machine with findOne, permit to have the right endDate.

@dynamiccast dynamiccast merged commit 1bb0d64 into Nanocloud:master Oct 10, 2016
@corentindrouet corentindrouet deleted the machine_randomly_deleted branch November 18, 2016 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants