NIFI-1119: - Addressing race condition that caused the revision to be checked before the flow was loaded.

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Matt Gilman 2015-12-15 09:11:15 -05:00 committed by jpercivall
parent 17be1c2d9f
commit c75b5cfcea
2 changed files with 8 additions and 3 deletions

View File

@ -978,7 +978,7 @@ nf.Canvas = (function () {
// get the process group to refresh everything
var processGroupXhr = reloadProcessGroup(nf.Canvas.getGroupId());
var statusXhr = reloadFlowStatus();
var settingsXhr = nf.Settings.loadSettings();
var settingsXhr = nf.Settings.loadSettings(false); // don't reload the status as we want to wait for deferreds to complete
$.when(processGroupXhr, statusXhr, settingsXhr).done(function (processGroupResult) {
// adjust breadcrumbs if necessary
var title = $('#data-flow-title-container');

View File

@ -1646,7 +1646,7 @@ nf.Settings = (function () {
/**
* Loads the settings.
*/
loadSettings: function () {
loadSettings: function (reloadStatus) {
var settings = $.ajax({
type: 'GET',
url: config.urls.controllerConfig,
@ -1680,7 +1680,12 @@ nf.Settings = (function () {
var reportingTasks = loadReportingTasks();
// return a deferred for all parts of the settings
return $.when(settings, controllerServices, reportingTasks).done(nf.Canvas.reloadStatus).fail(nf.Common.handleAjaxError);
return $.when(settings, controllerServices, reportingTasks).done(function () {
// always reload the status, unless the flag is specifically set to false
if (reloadStatus !== false) {
nf.Canvas.reloadStatus();
}
}).fail(nf.Common.handleAjaxError);
},
/**