mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 02:35:09 +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)
|
||||
// Else get it and cache it
|
||||
const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime;
|
||||
console.log(url);
|
||||
await https.get(url, (res) => {
|
||||
let body = "";
|
||||
res.on("data", (chunk) => {
|
||||
@ -1231,7 +1230,8 @@ apiRouter.post("/getOrchestratorScores", async (req, res) => {
|
||||
try {
|
||||
const { month, year } = req.body;
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user