Skip to content

Commit

Permalink
Opt: reduce i/o when calculating agent usage (#8261)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraggle authored Oct 26, 2024
1 parent 8e983ca commit 7e87f25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions front/lib/api/assistant/agent_usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ export async function agentMentionsCount(
model: Message,
required: true,
attributes: [],
where: {
createdAt: {
[Op.gt]: literal(`NOW() - INTERVAL '${rankingUsageDays} days'`),
},
},
include: [
{
model: Mention,
as: "mentions",
required: true,
attributes: [],
where: {
createdAt: {
[Op.gt]: literal(`NOW() - INTERVAL '${rankingUsageDays} days'`),
},
},
},
],
},
Expand Down

0 comments on commit 7e87f25

Please sign in to comment.