mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-09-11 14:36:35 +03:00
address comments left by @StanGirard on #2437 (feat(analytics): rely on sql rather that python loop for brains);
This commit is contained in:
parent
f0ad664673
commit
c3a042647e
@ -9,7 +9,6 @@ from modules.brain.service.brain_user_service import BrainUserService
|
|||||||
|
|
||||||
brain_user_service = BrainUserService()
|
brain_user_service = BrainUserService()
|
||||||
|
|
||||||
|
|
||||||
class Analytics:
|
class Analytics:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
supabase_client = get_supabase_client()
|
supabase_client = get_supabase_client()
|
||||||
@ -42,7 +41,7 @@ class Analytics:
|
|||||||
all_dates = [start_date + timedelta(days=i) for i in range(graph_range)]
|
all_dates = [start_date + timedelta(days=i) for i in range(graph_range)]
|
||||||
|
|
||||||
for date in all_dates:
|
for date in all_dates:
|
||||||
usage_per_day[date] += 0
|
pass
|
||||||
|
|
||||||
usages = sorted(
|
usages = sorted(
|
||||||
[
|
[
|
||||||
@ -53,4 +52,4 @@ class Analytics:
|
|||||||
key=lambda usage: usage.date,
|
key=lambda usage: usage.date,
|
||||||
)
|
)
|
||||||
|
|
||||||
return BrainsUsages(usages=usages)
|
return BrainsUsages(usages=usages)
|
Loading…
Reference in New Issue
Block a user