Skip to content

Commit ff13663

Browse files
ETL Token Limit (#96)
* perf: default token_limit for all orgs * style: trailing whitespace
1 parent 3fd4ddb commit ff13663

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

upgrade_logic/business_objects/gateway.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@
1010
from submodules.model import enums
1111

1212

13+
def gateway_1_19_0() -> bool:
14+
__gateway_1_19_0_add_organization_default_token_limit()
15+
return True
16+
17+
18+
def __gateway_1_19_0_add_organization_default_token_limit() -> bool:
19+
query = """
20+
UPDATE organization
21+
SET token_limit = jsonb_build_object(
22+
'file_upload_limit', 50,
23+
'file_upload_interval', 3600
24+
)
25+
WHERE token_limit IS NULL
26+
"""
27+
general.execute(query)
28+
general.commit()
29+
return True
30+
31+
1332
def gateway_1_16_0() -> bool:
1433
__gateway_1_16_0_add_cognition_project_folder_defaults()
1534
__gateway_1_16_0_add_cognition_project_tokenizer_defaults()

0 commit comments

Comments
 (0)