Put the reload GC changes behind a feature_flag

(imported from commit b009c2f4e5d76573902f335fb1a3b74622af6191)
This commit is contained in:
Jason Michalski
2014-02-10 15:26:25 -05:00
parent 47ca6b2800
commit c028dbe6b9
3 changed files with 30 additions and 16 deletions

View File

@@ -109,19 +109,7 @@ function clear_message_list(msg_list) {
msg_list._items = [{id: 1}];
}
function do_reload_app(send_after_reload, save_state, message) {
// TODO: we should completely disable the UI here
if (save_state) {
preserve_state(send_after_reload);
}
if (message === undefined) {
message = "Reloading";
}
// TODO: We need a better API for showing messages.
ui.report_message(message, $("#reloading-application"));
blueslip.log('Starting server requested page reload');
reload_in_progress = true;
function cleanup_before_reload() {
try {
// Unbind all the jQuery event listeners
$('*').off();
@@ -146,6 +134,27 @@ function do_reload_app(send_after_reload, save_state, message) {
blueslip.error('Failed to cleanup before reloading',
undefined, ex.stack);
}
}
function do_reload_app(send_after_reload, save_state, message) {
// TODO: we should completely disable the UI here
if (save_state) {
preserve_state(send_after_reload);
}
if (message === undefined) {
message = "Reloading";
}
// TODO: We need a better API for showing messages.
ui.report_message(message, $("#reloading-application"));
blueslip.log('Starting server requested page reload');
reload_in_progress = true;
if (feature_flags.cleanup_before_reload) {
cleanup_before_reload();
}
window.location.reload(true);
}