-
Notifications
You must be signed in to change notification settings - Fork 6
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
Checking for existing uProxy cloud server #379
Conversation
return Promise.reject({ | ||
'errcode': 'VM_DNE', | ||
'message': 'Droplet ' + name + ' doesnt exist' | ||
return Promise.resolve({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's probably better to reject if the droplet doesn't exist; this will help simplify destroyServer_
and start
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I updated getDroplet_
. Do you think this is better? Problem is that if getDroplet_
fails then start
should continue but if it returns a droplet then start
should throw an error. So start
wasn't really simplified, but I do think it's better if getDroplet_
throws an error.
Nice! One comment. |
* Finds a droplet with this name | ||
* @param {String} droplet name, as a string | ||
* @return {Promise.<Object>}, returns droplet if exists | ||
* or undefined if it does not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Better I think! A couple of suggestions then we'll be good to go. |
👍 ! |
getDroplet_()
start()
and returning unique error if server already existsthis.waitDigitalOceanActions_()
indestroyServer()
to determine when the DELETE action has been completed (so that we can then create a new server if necessary)This change is