use post response if config get request erroneously doesnt have license_info

This commit is contained in:
John Mitchell
2018-08-07 15:52:09 -04:00
parent d1f37ad1af
commit df42a65504
2 changed files with 8 additions and 3 deletions

View File

@@ -98,11 +98,11 @@ export default
$scope.submit = function() { $scope.submit = function() {
Wait('start'); Wait('start');
CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula) CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula)
.then(() => { .then((licenseInfo) => {
reset(); reset();
ConfigService.delete(); ConfigService.delete();
ConfigService.getConfig() ConfigService.getConfig(licenseInfo)
.then(function(config) { .then(function(config) {
delete($rootScope.features); delete($rootScope.features);
FeaturesService.get(); FeaturesService.get();

View File

@@ -21,7 +21,7 @@ export default
delete(this.config); delete(this.config);
}, },
getConfig: function () { getConfig: function (licenseInfo) {
var config = this.get(), var config = this.get(),
that = this, that = this,
deferred = $q.defer(); deferred = $q.defer();
@@ -31,6 +31,11 @@ export default
Wait('start'); Wait('start');
var promise = Rest.get(); var promise = Rest.get();
promise.then(function (response) { promise.then(function (response) {
// if applicable, use the license POSTs response if the config GET request is not returned due to a
// cluster cache update race condition
if (_.isEmpty(response.data.license_info) && !_.isEmpty(licenseInfo)) {
response.data.license_info = licenseInfo;
}
var config = response.data; var config = response.data;
$rootScope.configReady = true; $rootScope.configReady = true;
Wait('stop'); Wait('stop');