mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
possible fix for admin file descriptor stats on *bsd
This commit is contained in:
parent
7b65d3e8c8
commit
445f9cc617
@ -9,6 +9,7 @@ const Pinning = require("./pin-rpc");
|
||||
const Core = require("./core");
|
||||
const Channel = require("./channel");
|
||||
const BlockStore = require("../storage/block");
|
||||
const OS = require("node:os");
|
||||
|
||||
var Fs = require("fs");
|
||||
|
||||
@ -21,6 +22,15 @@ var getFileDescriptorCount = function (Env, server, cb) {
|
||||
});
|
||||
};
|
||||
|
||||
if (/bsd/i.test(OS.platform())) {
|
||||
getFileDescriptorCount = function (Env, server, cb) {
|
||||
Fs.readdir(`/dev/fd/${process.pid}`, function (err, list) {
|
||||
if (err) { return void cb(err); }
|
||||
cb(void 0, list.length);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
var getFileDescriptorLimit = function (env, server, cb) {
|
||||
Ulimit(cb);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user