Merge pull request #8627 from surajshetty3416/fix-clear-cache-issue

fix: Throttle clear cache
This commit is contained in:
mergify[bot] 2019-10-21 07:22:29 +00:00 committed by GitHub
commit 63eb588103
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,19 +225,16 @@ $.extend(frappe.ui.toolbar, {
},
});
frappe.ui.toolbar.clear_cache = function() {
frappe.ui.toolbar.clear_cache = frappe.utils.throttle(function() {
frappe.assets.clear_local_storage();
frappe.call({
method: 'frappe.sessions.clear',
callback: function(r) {
if(!r.exc) {
frappe.show_alert({message:r.message, indicator:'green'});
location.reload(true);
}
}
frappe.xcall('frappe.sessions.clear').then(message => {
frappe.show_alert({
message: message,
indicator: 'green'
});
location.reload(true);
});
return false;
};
}, 10000);
frappe.ui.toolbar.show_about = function() {
try {