mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Fix llm queries (#16006)
Release Notes: - N/A --------- Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
parent
06625bfe94
commit
240b7c641c
2
Procfile.postgrest
Normal file
2
Procfile.postgrest
Normal file
@ -0,0 +1,2 @@
|
||||
app: postgrest crates/collab/postgrest_app.conf
|
||||
llm: postgrest crates/collab/postgrest_llm.conf
|
4
crates/collab/postgrest_app.conf
Normal file
4
crates/collab/postgrest_app.conf
Normal file
@ -0,0 +1,4 @@
|
||||
db-uri = "postgres://postgres@localhost/zed_llm"
|
||||
server-port = 8082
|
||||
jwt-secret = "the-postgrest-jwt-secret-for-authorization"
|
||||
log-level = "info"
|
@ -173,12 +173,16 @@ impl LlmDatabase {
|
||||
|
||||
let users_in_recent_minutes = usage::Entity::find()
|
||||
.filter(usage::Column::Timestamp.gte(minute_since.naive_utc()))
|
||||
.select_only()
|
||||
.column(usage::Column::UserId)
|
||||
.group_by(usage::Column::UserId)
|
||||
.count(&*tx)
|
||||
.await? as usize;
|
||||
|
||||
let users_in_recent_days = usage::Entity::find()
|
||||
.filter(usage::Column::Timestamp.gte(day_since.naive_utc()))
|
||||
.select_only()
|
||||
.column(usage::Column::UserId)
|
||||
.group_by(usage::Column::UserId)
|
||||
.count(&*tx)
|
||||
.await? as usize;
|
||||
|
Loading…
Reference in New Issue
Block a user