Skip to content

Commit

Permalink
added ability to track status of upsert as well as improved ngnix
Browse files Browse the repository at this point in the history
  • Loading branch information
Formartha committed Mar 5, 2024
1 parent 1cdb1cf commit 6a3827e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<img src=".readme/ai1899-cover.jpeg" alt="ai1899 cover" width="220">

------

[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)

What?
------
ai1899 is a project designed for anyone seeking to utilize humanized queries for selecting test cases efficiently.
Expand Down
9 changes: 9 additions & 0 deletions ai1899/api_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ async def upsert_collection():
return jsonify({'error': str(e)}), 500


@ai_api.route('/check_upsert_status/<task_id>', methods=["GET"])
def check_task_status(task_id):
if request.method == "GET":
result = uc.AsyncResult(task_id)
return result.state # This will return the state of the task as a string
else:
return jsonify({"error": "Method Not Allowed"}), 405


@ai_api.route("/collections", methods=["GET"])
def get_collections():
return jsonify({"collections": [col.name for col in client.get_collections().collections]}), 200
Expand Down
10 changes: 6 additions & 4 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ http {
listen 80;

location /ai/ {
rewrite ^/ai/(.*) /ai/$1 break;
proxy_pass http://ai:5555/;
}

# There is a known issue with qdrant behind reverse proxy, pending for solution: https://github.com/qdrant/qdrant-web-ui/issues/94
#location /qdrant/ {
# proxy_pass http://qdrant-container:6333/dashboard/;
#}
location /qdrant/ {
rewrite ^/qdrant/(.*) /$1 break;
proxy_pass http://qdrant-container:6333/;
}

location /redis-commander/ {
rewrite ^/redis-commander/(.*) /$1 break;
proxy_pass http://redis-commander:8081/;
}

Expand Down

0 comments on commit 6a3827e

Please sign in to comment.