This commit is contained in:
parent
b720e96431
commit
6d4d1e782f
@ -21,7 +21,7 @@ const getScoreCountHistoryQuery = `from(bucket: "${INFLUXDB_BUCKET}")
|
|||||||
|> filter(fn: (r) => r["_measurement"] == "scoresaber")
|
|> filter(fn: (r) => r["_measurement"] == "scoresaber")
|
||||||
|> filter(fn: (r) => r["_field"] == "value")
|
|> filter(fn: (r) => r["_field"] == "value")
|
||||||
|> filter(fn: (r) => r["type"] == "score_count")
|
|> filter(fn: (r) => r["type"] == "score_count")
|
||||||
|> aggregateWindow(every: -{}, fn: spread, createEmpty: true)
|
|> aggregateWindow(every: {}, fn: spread, createEmpty: true)
|
||||||
`;
|
`;
|
||||||
|
|
||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
@ -31,7 +31,7 @@ app.get("/", (req, res) => {
|
|||||||
app.get("/analytics", async (req, res) => {
|
app.get("/analytics", async (req, res) => {
|
||||||
const before = new Date().getTime();
|
const before = new Date().getTime();
|
||||||
|
|
||||||
const timeQuery = req.query.time || "24h";
|
const timeQuery = req.query.time || "30d";
|
||||||
const timeInMs = parseTimeToMilliseconds(timeQuery.toString());
|
const timeInMs = parseTimeToMilliseconds(timeQuery.toString());
|
||||||
if (timeInMs > 30 * 24 * 60 * 60 * 1000) {
|
if (timeInMs > 30 * 24 * 60 * 60 * 1000) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
|
Loading…
Reference in New Issue
Block a user