aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/viewsets/bot
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-12-16 22:29:11 +0000
committerGravatar Chris Lovering <[email protected]>2021-12-16 22:29:11 +0000
commit59e4a5c8316464e116630a329064decac4c2a075 (patch)
tree2cd805a4c69018dff65329bb195376699c60a4aa /pydis_site/apps/api/viewsets/bot
parentMerge pull request #635 from python-discord/revert-metricity-change (diff)
Always include metricity message blocks
Thanks to a recent database maintenance (https://pythondiscord.freshstatus.io/incident/139811) querying out metricity message data is far cheaper. So there is no longer a reason to only fetch blocks if the member has a low message count.
Diffstat (limited to 'pydis_site/apps/api/viewsets/bot')
-rw-r--r--pydis_site/apps/api/viewsets/bot/user.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/user.py b/pydis_site/apps/api/viewsets/bot/user.py
index ed661323..1a5e79f8 100644
--- a/pydis_site/apps/api/viewsets/bot/user.py
+++ b/pydis_site/apps/api/viewsets/bot/user.py
@@ -273,11 +273,7 @@ class UserViewSet(ModelViewSet):
data = metricity.user(user.id)
data["total_messages"] = metricity.total_messages(user.id)
- if data["total_messages"] < 1000:
- # Only calculate and return activity_blocks if the user has a small amount
- # of messages, as calculating activity_blocks is expensive.
- # 1000 message chosen as an arbitrarily large number.
- data["activity_blocks"] = metricity.total_message_blocks(user.id)
+ data["activity_blocks"] = metricity.total_message_blocks(user.id)
data["voice_banned"] = voice_banned
return Response(data, status=status.HTTP_200_OK)