mirror of https://github.com/xwiki-labs/cryptpad
implement an admin rpc to fetch ulimit data
This commit is contained in:
parent
81c7416095
commit
2d47e7e2cf
|
@ -2,6 +2,7 @@
|
|||
const nThen = require("nthen");
|
||||
const getFolderSize = require("get-folder-size");
|
||||
const Util = require("../common-util");
|
||||
const Ulimit = require("ulimit");
|
||||
|
||||
var Fs = require("fs");
|
||||
|
||||
|
@ -14,6 +15,10 @@ var getFileDescriptorCount = function (Env, server, cb) {
|
|||
});
|
||||
};
|
||||
|
||||
var getFileDescriptorLimit = function (env, server, cb) {
|
||||
Ulimit(cb);
|
||||
};
|
||||
|
||||
var getActiveSessions = function (Env, Server, cb) {
|
||||
var stats = Server.getSessionStats();
|
||||
cb(void 0, [
|
||||
|
@ -113,6 +118,7 @@ var commands = {
|
|||
FLUSH_CACHE: flushCache,
|
||||
SHUTDOWN: shutdown,
|
||||
GET_FILE_DESCRIPTOR_COUNT: getFileDescriptorCount,
|
||||
GET_FILE_DESCRIPTOR_LIMIT: getFileDescriptorLimit,
|
||||
};
|
||||
|
||||
Admin.command = function (Env, safeKey, data, _cb, Server) {
|
||||
|
|
|
@ -1244,6 +1244,11 @@
|
|||
"mime-types": "~2.1.24"
|
||||
}
|
||||
},
|
||||
"ulimit": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ulimit/-/ulimit-0.0.2.tgz",
|
||||
"integrity": "sha1-K1H53IOBrkECY2zsXrM4wmMFiKA="
|
||||
},
|
||||
"ultron": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
"sortify": "^1.0.4",
|
||||
"stream-to-pull-stream": "^1.7.2",
|
||||
"tweetnacl": "~0.12.2",
|
||||
"ulimit": "0.0.2",
|
||||
"ws": "^3.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in New Issue