|
|
|
@ -211,6 +211,21 @@ the server adds two pieces of information to the supplied decree:
|
|
|
|
|
Decrees.write(Env, decree, cb);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// CryptPad_AsyncStore.rpc.send('ADMIN', ['SET_LAST_EVICTION', 0], console.log)
|
|
|
|
|
var setLastEviction = function (Env, Server, cb, data, unsafeKey) {
|
|
|
|
|
var time = data && data[1];
|
|
|
|
|
if (typeof(time) !== 'number') {
|
|
|
|
|
return void cb('INVALID_ARGS');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Env.lastEviction = time;
|
|
|
|
|
cb();
|
|
|
|
|
Env.Log.info('LAST_EVICTION_TIME_SET', {
|
|
|
|
|
author: unsafeKey,
|
|
|
|
|
time: time,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// CryptPad_AsyncStore.rpc.send('ADMIN', ['INSTANCE_STATUS], console.log)
|
|
|
|
|
var instanceStatus = function (Env, Server, cb) {
|
|
|
|
|
cb(void 0, {
|
|
|
|
@ -225,8 +240,8 @@ var instanceStatus = function (Env, Server, cb) {
|
|
|
|
|
defaultStorageLimit: Env.defaultStorageLimit,
|
|
|
|
|
|
|
|
|
|
lastEviction: Env.lastEviction,
|
|
|
|
|
// FIXME eviction is run in a worker and this isn't returned
|
|
|
|
|
//knownActiveAccounts: Env.knownActiveAccounts,
|
|
|
|
|
evictionReport: Env.evictionReport,
|
|
|
|
|
|
|
|
|
|
disableIntegratedEviction: Env.disableIntegratedEviction,
|
|
|
|
|
disableIntegratedTasks: Env.disableIntegratedTasks,
|
|
|
|
|
|
|
|
|
@ -257,6 +272,7 @@ var commands = {
|
|
|
|
|
ADMIN_DECREE: adminDecree,
|
|
|
|
|
INSTANCE_STATUS: instanceStatus,
|
|
|
|
|
GET_LIMITS: getLimits,
|
|
|
|
|
SET_LAST_EVICTION: setLastEviction,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Admin.command = function (Env, safeKey, data, _cb, Server) {
|
|
|
|
|