logging & missing func & allow respawning on crash
This commit is contained in:
parent
bf6acbbadf
commit
466544b8ed
@ -1,7 +1,7 @@
|
||||
{
|
||||
"serverFilePath": "./src/server/Server.js",
|
||||
"shardOptions": {
|
||||
"respawn": false
|
||||
"respawn": true
|
||||
},
|
||||
"shardCount": 1,
|
||||
"serverOptions": {
|
||||
|
@ -201,7 +201,7 @@ class Server extends EventEmitter {
|
||||
|
||||
#logRequest (req, res, next) {
|
||||
res.once('finish', () => {
|
||||
this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] Request to [${req.method}] ${req.route?.path || req.path}`);
|
||||
this.logger[[ 401, 403 ].includes(res.statusCode) ? 'unauthorised' : 'access'](`[${req.get('X-Forwarded-For') || req.socket.remoteAddress}] [STATUS: ${res.statusCode}] ${req.user ? `${req.user.name} (${req.user.id})` : '-'} Request to [${req.method}] ${req.route?.path || req.path}`);
|
||||
});
|
||||
next();
|
||||
}
|
||||
|
@ -59,12 +59,9 @@ class User extends AbstractUser {
|
||||
return Object.freeze({ ...this.#_externalProfiles });
|
||||
}
|
||||
|
||||
// async fetchApplications () {
|
||||
// const apps = await Promise.all(this._applications.map(id => this._db.fetchApplication(id)));
|
||||
// for (const app of apps)
|
||||
// this.applications[app.id] = app;
|
||||
// return this.applications;
|
||||
// }
|
||||
async fetchApplications () {
|
||||
return Promise.all(this.#_applications.map(id => this._db.fetchApplication(id)));
|
||||
}
|
||||
|
||||
async createApplication (name, { description } = {}, saveFn) {
|
||||
if (typeof saveFn !== 'function')
|
||||
|
Loading…
Reference in New Issue
Block a user