feat: ability to clear cache from acp
parent
69fb15276c
commit
bbc7737e14
@ -0,0 +1,20 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
define('admin/advanced/cache', function () {
|
||||||
|
var Cache = {};
|
||||||
|
Cache.init = function () {
|
||||||
|
require(['admin/settings'], function (Settings) {
|
||||||
|
Settings.prepare();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#clear').on('click', function () {
|
||||||
|
socket.emit('admin.cache.clear', function (err) {
|
||||||
|
if (err) {
|
||||||
|
return app.alertError(err.message);
|
||||||
|
}
|
||||||
|
ajaxify.refresh();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return Cache;
|
||||||
|
});
|
@ -0,0 +1,10 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const SocketCache = module.exports;
|
||||||
|
|
||||||
|
SocketCache.clear = async function () {
|
||||||
|
require('../../posts/cache').reset();
|
||||||
|
require('../../database').objectCache.reset();
|
||||||
|
require('../../groups').cache.reset();
|
||||||
|
require('../../cache').reset();
|
||||||
|
};
|
Loading…
Reference in New Issue