mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 10:45:10 +02:00
Fix taking the right months for scores
This commit is contained in:
parent
54ac14c33b
commit
b38b4d9e7c
@ -1190,7 +1190,6 @@ const getScoreAtMonthYear = async function (month, year) {
|
|||||||
const endTime = parseInt(Date.parse(endString) / 1000)
|
const endTime = parseInt(Date.parse(endString) / 1000)
|
||||||
// Else get it and cache it
|
// Else get it and cache it
|
||||||
const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime;
|
const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime;
|
||||||
console.log(url);
|
|
||||||
await https.get(url, (res) => {
|
await https.get(url, (res) => {
|
||||||
let body = "";
|
let body = "";
|
||||||
res.on("data", (chunk) => {
|
res.on("data", (chunk) => {
|
||||||
@ -1231,7 +1230,8 @@ apiRouter.post("/getOrchestratorScores", async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
const { month, year } = req.body;
|
const { month, year } = req.body;
|
||||||
if (month && year) {
|
if (month && year) {
|
||||||
const reqObj = await getScoreAtMonthYear(month, year);
|
// Since months get counted starting at 0
|
||||||
|
const reqObj = await getScoreAtMonthYear(month + 1, year);
|
||||||
res.send(reqObj);
|
res.send(reqObj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user