|
|
|
@ -2,11 +2,23 @@
|
|
|
|
|
const nThen = require("nthen");
|
|
|
|
|
const getFolderSize = require("get-folder-size");
|
|
|
|
|
const Util = require("../common-util");
|
|
|
|
|
const Ulimit = require("ulimit");
|
|
|
|
|
|
|
|
|
|
var Fs = require("fs");
|
|
|
|
|
|
|
|
|
|
var Admin = module.exports;
|
|
|
|
|
|
|
|
|
|
var getFileDescriptorCount = function (Env, server, cb) {
|
|
|
|
|
Fs.readdir('/proc/self/fd', function(err, list) {
|
|
|
|
|
if (err) { return void cb(err); }
|
|
|
|
|
cb(void 0, list.length);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var getFileDescriptorLimit = function (env, server, cb) {
|
|
|
|
|
Ulimit(cb);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var getActiveSessions = function (Env, Server, cb) {
|
|
|
|
|
var stats = Server.getSessionStats();
|
|
|
|
|
cb(void 0, [
|
|
|
|
@ -105,6 +117,8 @@ var commands = {
|
|
|
|
|
DISK_USAGE: getDiskUsage,
|
|
|
|
|
FLUSH_CACHE: flushCache,
|
|
|
|
|
SHUTDOWN: shutdown,
|
|
|
|
|
GET_FILE_DESCRIPTOR_COUNT: getFileDescriptorCount,
|
|
|
|
|
GET_FILE_DESCRIPTOR_LIMIT: getFileDescriptorLimit,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Admin.command = function (Env, safeKey, data, _cb, Server) {
|
|
|
|
|