日志:处理日志保存数量、大小
This commit is contained in:
@@ -8,7 +8,7 @@ import { UserModel } from "../../../db/User";
|
||||
import { SERVER_DEBUG_MODE } from "../../../pubUtils/dicParam";
|
||||
import { nowSeconds } from "../../../pubUtils/timeUtil";
|
||||
import { getServerMainten } from "../../../services/gmService";
|
||||
import { errlogger } from "../../../util/logger";
|
||||
// import { errlogger } from "../../../util/logger";
|
||||
export function globalFilter(app: Application) {
|
||||
return new Filter(app);
|
||||
}
|
||||
@@ -32,7 +32,7 @@ Filter.prototype.before = async function (routeRecord: RouteRecord, msg: any, se
|
||||
if(this.accessTime && this.accessTime.has(keyOfRouteWithUser)) {
|
||||
console.log(this.accessTime.get(keyOfRouteWithUser) - Date.now());
|
||||
if(Date.now() - this.accessTime.get(keyOfRouteWithUser) < ACCESS_FREQUENCY) {
|
||||
errlogger.error(`${keyOfRouteWithUser} 间隔时间小于${ACCESS_FREQUENCY}ms,为 ${Date.now() - this.accessTime.get(keyOfRouteWithUser)}`);
|
||||
// errlogger.error(`${keyOfRouteWithUser} 间隔时间小于${ACCESS_FREQUENCY}ms,为 ${Date.now() - this.accessTime.get(keyOfRouteWithUser)}`);
|
||||
// return next(new Error(), resResult(STATUS.ACCESS_BUSY));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user