mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-23 10:26:02 +00:00
✨ changed and fixed compiler
This commit is contained in:
@@ -4,7 +4,7 @@ process.on("uncaughtException", console.error);
|
||||
import http from "http";
|
||||
import * as Api from "@fosscord/api";
|
||||
import * as Gateway from "@fosscord/gateway";
|
||||
import { CDNServer } from "@fosscord/cdn/";
|
||||
import { CDNServer } from "@fosscord/cdn";
|
||||
import express from "express";
|
||||
import { green, bold } from "nanocolors";
|
||||
import { Config, initDatabase } from "@fosscord/util";
|
||||
|
||||
@@ -1,20 +1,4 @@
|
||||
// process.env.MONGOMS_DEBUG = "true";
|
||||
const tsConfigPaths = require("tsconfig-paths");
|
||||
const path = require("path");
|
||||
const baseUrl = path.join(__dirname, "..");
|
||||
const cleanup = tsConfigPaths.register({
|
||||
baseUrl,
|
||||
paths: {
|
||||
"@fosscord/api": ["../api/dist/index.js"],
|
||||
"@fosscord/api/*": ["../api/dist/*"],
|
||||
"@fosscord/gateway": ["../gateway/dist/index.js"],
|
||||
"@fosscord/gateway/*": ["../gateway/dist/*"],
|
||||
"@fosscord/cdn": ["../cdn/dist/index.js"],
|
||||
"@fosscord/cdn/*": ["../cdn/dist/*"],
|
||||
},
|
||||
});
|
||||
console.log(require("@fosscord/gateway"));
|
||||
|
||||
import "reflect-metadata";
|
||||
import cluster from "cluster";
|
||||
import os from "os";
|
||||
|
||||
+9
-1
@@ -1,11 +1,19 @@
|
||||
import os from "os";
|
||||
import osu from "node-os-utils";
|
||||
import { red } from "nanocolors";
|
||||
|
||||
export function initStats() {
|
||||
console.log(`[Path] running in ${__dirname}`);
|
||||
console.log(`[CPU] ${osu.cpu.model()} Cores x${osu.cpu.count()}`);
|
||||
console.log(`[System] ${os.platform()} ${os.arch()}`);
|
||||
console.log(`[Process] running with pid: ${process.pid}`);
|
||||
if (process.getuid() === 0) {
|
||||
console.warn(
|
||||
red(
|
||||
`[Process] Warning fosscord is running as root, this highly discouraged and might expose your system vulnerable to attackers. Please run fosscord as a user without root privileges.`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
setInterval(async () => {
|
||||
const [cpuUsed, memory, network] = await Promise.all([
|
||||
@@ -23,5 +31,5 @@ export function initStats() {
|
||||
process.memoryUsage().rss / 1024 / 1024
|
||||
)}mb/${memory.totalMemMb.toFixed(0)}mb ${networkUsage}`
|
||||
);
|
||||
}, 1000 * 5);
|
||||
}, 1000 * 10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user