-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove the dependency on bot_id in the task scheduling process #441
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,6 @@ | |
def get_task( | ||
task_type: TaskType, | ||
task_id: str, | ||
bot_id: Optional[str], | ||
) -> GitTask: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify that the removal of |
||
supabase = get_client() | ||
response = ( | ||
|
@@ -75,7 +74,6 @@ | |
sha=data["sha"], | ||
repo_name=data["repo_name"], | ||
node_type=data["node_type"], | ||
bot_id=bot_id, | ||
path=data["path"], | ||
status=data["status"], | ||
from_id=data["from_task_id"], | ||
|
@@ -92,8 +90,8 @@ | |
) | ||
|
||
|
||
def trigger_task(task_type: TaskType, bot_id: Optional[str], task_id: Optional[str]): | ||
task = get_task(task_type, bot_id, task_id) if task_id else get_oldest_task() | ||
def trigger_task(task_type: TaskType, task_id: Optional[str]): | ||
task = get_task(task_type, task_id) if task_id else get_oldest_task() | ||
if task is None: | ||
return task | ||
return task.handle() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "petercat_utils" | ||
version = "0.1.38" | ||
version = "0.1.39" | ||
description = "" | ||
authors = ["raoha.rh <[email protected]>"] | ||
readme = "README.md" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,11 @@ | |
from fastapi import APIRouter, Depends | ||
from petercat_utils.db.client.supabase import get_client | ||
|
||
from petercat_utils.data_class import RAGGitDocConfig, RAGGitIssueConfig, TaskType | ||
from petercat_utils.data_class import ( | ||
RAGGitDocConfig, | ||
RAGGitIssueConfig, | ||
TaskType, | ||
) | ||
from petercat_utils.rag_helper import ( | ||
retrieval, | ||
task, | ||
|
@@ -82,9 +86,9 @@ | |
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check that the removal of |
||
@router.post("/rag/trigger_task", dependencies=[Depends(verify_rate_limit)]) | ||
def trigger_task(task_type: TaskType, bot_id: str, task_id: Optional[str] = None): | ||
def trigger_task(task_type: TaskType, task_id: Optional[str] = None): | ||
try: | ||
task.trigger_task(task_type, task_id, bot_id) | ||
task.trigger_task(task_type, task_id) | ||
except Exception as e: | ||
return json.dumps({"success": False, "message": str(e)}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that removing
bot_id
does not affect any logic that relies on it. Double-check that all references tobot_id
are correctly handled or removed.