From aaeedfa67c17a4c06cfdce263655b655ee6724d5 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Mon, 2 Dec 2024 20:20:33 +0000 Subject: [PATCH] refactor: increase computer data limit from 50 to 60 (again) --- internal/service/computer.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/computer.go b/internal/service/computer.go index ffb4db6..80136b4 100644 --- a/internal/service/computer.go +++ b/internal/service/computer.go @@ -11,11 +11,11 @@ var ComputerData model.ComputerData = model.ComputerData{ } func initializeGraphData() []model.ComputerGraphData { - graphData := make([]model.ComputerGraphData, 50) + graphData := make([]model.ComputerGraphData, 60) - for i := 0; i < 50; i++ { + for i := 0; i < 60; i++ { graphData[i] = model.ComputerGraphData{ - Timestamp: time.Now().Truncate(1 * time.Minute).Add(time.Duration(-50+i) * time.Minute), + Timestamp: time.Now().Truncate(1 * time.Minute).Add(time.Duration(-60+i) * time.Minute), Cpu: 0, Ram: 0, } @@ -31,7 +31,7 @@ func AddComputerData(clientMessage model.ComputerWebSocketMessage) { Ram: int(clientMessage.Ram), }) - if len(ComputerData.Graph) > 50 { + if len(ComputerData.Graph) > 60 { ComputerData.Graph = ComputerData.Graph[1:] } }