Skip to content

Commit

Permalink
Experiment with 4h lookback window for mirror rating
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 28, 2024
1 parent b40a93f commit 68aff15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/repositories/beatmap_mirror_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def get_mirror_weight(mirror_name: str) -> int:
SELECT (ended_at - started_at) * 1000 AS ms_elapsed,
PERCENT_RANK() OVER (ORDER BY ended_at - started_at) p
FROM beatmap_mirror_requests
WHERE started_at > NOW() - INTERVAL 1 DAY
WHERE started_at > NOW() - INTERVAL 4 HOUR
AND mirror_name = :mirror_name
AND success = 1
)
Expand All @@ -41,7 +41,7 @@ async def get_mirror_weight(mirror_name: str) -> int:
"""\
SELECT AVG(success = 0)
FROM beatmap_mirror_requests
WHERE started_at > NOW() - INTERVAL 1 DAY
WHERE started_at > NOW() - INTERVAL 4 HOUR
AND mirror_name = :mirror_name
""",
{"mirror_name": mirror_name},
Expand Down

0 comments on commit 68aff15

Please sign in to comment.