refactor: Move setting of database in front
This commit is contained in:
parent
c5c09b2cfa
commit
814c49332a
1 changed files with 3 additions and 3 deletions
|
|
@ -47,6 +47,9 @@ def get_crewai_router() -> APIRouter:
|
||||||
payload: CrewAIRunPayloadDTO,
|
payload: CrewAIRunPayloadDTO,
|
||||||
user: User = Depends(get_authenticated_user),
|
user: User = Depends(get_authenticated_user),
|
||||||
):
|
):
|
||||||
|
# Set context based database settings if necessary
|
||||||
|
await set_database_global_context_variables("Github", user.id)
|
||||||
|
|
||||||
await prune_data(user)
|
await prune_data(user)
|
||||||
await prune_system(user)
|
await prune_system(user)
|
||||||
|
|
||||||
|
|
@ -69,9 +72,6 @@ def get_crewai_router() -> APIRouter:
|
||||||
await give_permission_on_dataset(user, github_dataset.id, "delete")
|
await give_permission_on_dataset(user, github_dataset.id, "delete")
|
||||||
await give_permission_on_dataset(user, github_dataset.id, "share")
|
await give_permission_on_dataset(user, github_dataset.id, "share")
|
||||||
|
|
||||||
# Set context based database settings if necessary
|
|
||||||
await set_database_global_context_variables("Github", user.id)
|
|
||||||
|
|
||||||
await run_github_ingestion(user, github_dataset, payload.username1, payload.username2)
|
await run_github_ingestion(user, github_dataset, payload.username1, payload.username2)
|
||||||
|
|
||||||
applicants = {
|
applicants = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue