summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-11-06 03:31:16 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-11-06 03:31:16 +0900
commit6c5a78aeb264ef458a2cea0bfe516172e8f1f5e7 (patch)
tree04b47aea09ea273e54a8480cbc6dd58725e0b49f /src
parent10.40.0 (diff)
downloadsharkey-6c5a78aeb264ef458a2cea0bfe516172e8f1f5e7.tar.gz
sharkey-6c5a78aeb264ef458a2cea0bfe516172e8f1f5e7.tar.bz2
sharkey-6c5a78aeb264ef458a2cea0bfe516172e8f1f5e7.zip
Fix #3133 (#3134)
Diffstat (limited to 'src')
-rw-r--r--src/index.ts2
-rw-r--r--src/misc/machineInfo.ts10
2 files changed, 7 insertions, 5 deletions
diff --git a/src/index.ts b/src/index.ts
index 259f5b1b0c..ae358105fb 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -114,7 +114,7 @@ async function init(): Promise<Config> {
Logger.info(`<<< Misskey v${pkg.version} >>>`);
new Logger('Deps').info(`Node.js ${process.version}`);
- MachineInfo.show();
+ await MachineInfo.show();
EnvironmentInfo.show();
const configLogger = new Logger('Config');
diff --git a/src/misc/machineInfo.ts b/src/misc/machineInfo.ts
index 6049bcfc9c..7d8a52ff9a 100644
--- a/src/misc/machineInfo.ts
+++ b/src/misc/machineInfo.ts
@@ -1,15 +1,17 @@
import * as os from 'os';
import Logger from './logger';
+import * as sysUtils from 'systeminformation';
export default class {
- public static show(): void {
- const totalmem = (os.totalmem() / 1024 / 1024 / 1024).toFixed(1);
- const freemem = (os.freemem() / 1024 / 1024 / 1024).toFixed(1);
+ public static async show() {
const logger = new Logger('Machine');
logger.info(`Hostname: ${os.hostname()}`);
logger.info(`Platform: ${process.platform}`);
logger.info(`Architecture: ${process.arch}`);
logger.info(`CPU: ${os.cpus().length} core`);
- logger.info(`MEM: ${totalmem}GB (available: ${freemem}GB)`);
+ const mem = await sysUtils.mem();
+ const totalmem = (mem.total / 1024 / 1024 / 1024).toFixed(1);
+ const availmem = (mem.available / 1024 / 1024 / 1024).toFixed(1);
+ logger.info(`MEM: ${totalmem}GB (available: ${availmem}GB)`);
}
}