@@ -20,6 +20,10 @@ import { Table } from "./types";
20
20
21
21
export const MAX_FILENAME_SEARCH_RESULTS = 100 ;
22
22
23
+ const PROJECTS_LIMIT = 300 ;
24
+ const PROJECTS_CUTOFF = "6 weeks" ;
25
+ const THROTTLE_CHANGES = 1000 ;
26
+
23
27
Table ( {
24
28
name : "projects" ,
25
29
rules : {
@@ -48,12 +52,15 @@ Table({
48
52
49
53
user_query : {
50
54
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" } ] ,
55
62
pg_changefeed : "projects" ,
56
- throttle_changes : 2000 ,
63
+ throttle_changes : THROTTLE_CHANGES ,
57
64
fields : {
58
65
project_id : null ,
59
66
name : null ,
0 commit comments