An open source, non-profit web search engine
Merge main
blueheron7860004c2a072dd
diff --git a/mwmbl/crawler/stats.py b/mwmbl/crawler/stats.pyindex 5f57a2a..f7883f3 100644--- a/mwmbl/crawler/stats.py+++ b/mwmbl/crawler/stats.py@@ -1,15 +1,11 @@-import gzipfrom datetime import date, datetime, timedelta, timezone-from glob import glob-from itertools import islicefrom logging import getLogger-import djangofrom pydantic import BaseModelfrom redis import Redisfrom mwmbl.count_urls import get_counts, get_domain_result_count-from mwmbl.crawler.batch import HashedBatch, Results+from mwmbl.crawler.batch import Resultsfrom mwmbl.utils import utc_todaylogger = getLogger(__name__)@@ -89,6 +85,7 @@ class StatsManager:def __init__(self, redis: Redis):self.redis = redis+def get_stats(self) -> MwmblStats:date_time = datetime.now(timezone.utc)date = date_time.date()diff --git a/mwmbl/platform/schemas.py b/mwmbl/platform/schemas.pyindex 104f6a6..35273a1 100644--- a/mwmbl/platform/schemas.py+++ b/mwmbl/platform/schemas.py@@ -23,6 +23,14 @@ class UserStatsResponse(Schema):results_indexed_daily: dict[str, int]+class UserStatsResponse(Schema):+ """Per-user contribution stats for the logged-in user."""++ username: str+ results_indexed_today: int+ results_indexed_daily: dict[str, int]++class SubscriptionResponse(Schema):status: strmax_monthly_spend_cents: int