From fe495731b12820fc51c492184d54523e21c7c5f2 Mon Sep 17 00:00:00 2001 From: Tom Bertrand Date: Wed, 28 Feb 2024 13:49:43 -0500 Subject: [PATCH] fix nanptps data --- server/cron/nanotpsStats.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/cron/nanotpsStats.js b/server/cron/nanotpsStats.js index 0f0ee201..305f89c4 100644 --- a/server/cron/nanotpsStats.js +++ b/server/cron/nanotpsStats.js @@ -12,9 +12,9 @@ const doNanoTpsStats = async () => { const { send: sends, receive: receives, change: changes } = await res.json(); - let send = sends[sends.length - 1]; - let receive = receives[receives.length - 1]; - let change = changes[changes.length - 1]; + let send = sends[0]; + let receive = receives[0]; + let change = changes[0]; const stats = { send, receive, change }; @@ -32,3 +32,5 @@ cron.schedule("0 * * * *", async () => { if (process.env.NODE_ENV === "production") { doNanoTpsStats(); } + +doNanoTpsStats();