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
[API] Fix model monitoring endpoints sync/async separation #885
[API] Fix model monitoring endpoints sync/async separation #885
Conversation
await run_in_threadpool( | ||
ModelEndpoints.create_or_patch, | ||
access_key=access_key, | ||
model_endpoint=model_endpoint, |
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.
I think this endpoint can be changed to be sync as well
@@ -47,8 +50,11 @@ async def delete_endpoint_record( | |||
Clears endpoint record from KV by endpoint_id | |||
""" | |||
access_key = get_access_key(request.headers) | |||
await ModelEndpoints.delete_endpoint_record( | |||
access_key=access_key, project=project, endpoint_id=endpoint_id | |||
await run_in_threadpool( |
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.
same
@@ -79,7 +85,8 @@ async def list_endpoints( | |||
api/projects/{project}/model-endpoints/?label=mylabel=1,myotherlabel=2 | |||
""" | |||
access_key = get_access_key(request.headers) | |||
endpoints = await ModelEndpoints.list_endpoints( | |||
endpoints = await run_in_threadpool( |
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.
same
@@ -105,7 +112,8 @@ async def get_endpoint( | |||
feature_analysis: bool = Query(default=False), | |||
) -> ModelEndpoint: | |||
access_key = get_access_key(request.headers) | |||
endpoint = await ModelEndpoints.get_endpoint( | |||
endpoint = await run_in_threadpool( |
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.
same
…threadpool