This commit is contained in:
Acid Chicken (硫酸鶏) 2018-12-02 13:54:16 +09:00 committed by syuilo
parent a12e8ccb15
commit ce6bd6a7c3

View file

@ -38,7 +38,7 @@ export default class ServerModule implements IModule {
private check = () => {
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length;
const cpuPercentages = this.statsLogs.map(s => s.cpu_usage * 100);
const cpuPercentages = this.statsLogs.map(s => s && s.cpu_usage * 100 || 0);
const cpuPercentage = average(cpuPercentages);
if (cpuPercentage >= 70) {
this.warn();