Skip to content

Commit 4698e8c

Browse files
committed
make code a little clearer and slightly increase limits for initial projects load
1 parent 558d759 commit 4698e8c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/packages/util/db-schema/projects.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import { Table } from "./types";
2020

2121
export const MAX_FILENAME_SEARCH_RESULTS = 100;
2222

23+
const PROJECTS_LIMIT = 300;
24+
const PROJECTS_CUTOFF = "6 weeks";
25+
const THROTTLE_CHANGES = 1000;
26+
2327
Table({
2428
name: "projects",
2529
rules: {
@@ -48,12 +52,15 @@ Table({
4852

4953
user_query: {
5054
get: {
51-
pg_where: ["last_edited >= NOW() - interval '21 days'", "projects"],
52-
pg_where_load: ["last_edited >= NOW() - interval '2 days'", "projects"],
53-
options: [{ limit: 100, order_by: "-last_edited" }],
54-
options_load: [{ limit: 15, order_by: "-last_edited" }],
55+
pg_where: [
56+
`last_edited >= NOW() - interval '${PROJECTS_CUTOFF}'`,
57+
"projects",
58+
],
59+
pg_where_load: ["last_edited >= NOW() - interval '7 days'", "projects"],
60+
options: [{ limit: PROJECTS_LIMIT, order_by: "-last_edited" }],
61+
options_load: [{ limit: 50, order_by: "-last_edited" }],
5562
pg_changefeed: "projects",
56-
throttle_changes: 2000,
63+
throttle_changes: THROTTLE_CHANGES,
5764
fields: {
5865
project_id: null,
5966
name: null,

0 commit comments

Comments
 (0)