mirror of
https://github.com/syuilo/ai.git
synced 2024-11-22 13:17:59 +00:00
Fix bug
This commit is contained in:
parent
6037e49b01
commit
ccb00e218f
|
@ -54,7 +54,7 @@ export default class ServerModule implements IModule {
|
||||||
private check = () => {
|
private check = () => {
|
||||||
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length;
|
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length;
|
||||||
|
|
||||||
const memPercentages = this.statsLogs.map(s => (s.mem.total - s.mem.used) * 100);
|
const memPercentages = this.statsLogs.map(s => (s.mem.used / s.mem.total) * 100);
|
||||||
const memPercentage = average(memPercentages);
|
const memPercentage = average(memPercentages);
|
||||||
if (memPercentage >= 90) {
|
if (memPercentage >= 90) {
|
||||||
this.scheduleReboot('mem');
|
this.scheduleReboot('mem');
|
||||||
|
|
Loading…
Reference in a new issue