nodejitsu-api
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -224,12 +224,26 @@ 'use strict'; | ||
this.cloud({ method: 'POST', uri: argv, body: cloud, appName: appName }, this.request, function (err, result) { | ||
// | ||
// Assume that this call invalidates our cached datacenter endpoint, so | ||
// remove it, and it will be fetched again on the next call | ||
// | ||
delete self.clouds[appName]; | ||
// Ensure the app is started before we try to set the datacenter. | ||
this.view(appName, function (err, current) { | ||
if (err) throw err; | ||
if (err) return callback(err); | ||
callback(err, result); | ||
if (!current.config.cloud) { | ||
self.start(appName, executeCloud); | ||
} | ||
else { | ||
executeCloud(); | ||
} | ||
}); | ||
function executeCloud() { | ||
self.cloud({ method: 'POST', uri: argv, body: cloud, appName: appName }, self.request, function (err, result) { | ||
// | ||
// Assume that this call invalidates our cached datacenter endpoint, so | ||
// remove it, and it will be fetched again on the next call | ||
// | ||
delete self.clouds[appName]; | ||
if (err) return callback(err); | ||
callback(err, result); | ||
}); | ||
} | ||
}; |
{ | ||
"name": "nodejitsu-api", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "nodejitsu API client wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": ["nodejitsu", "nodejitsu-api"], |
70076
1598