Skip to content

Commit

Permalink
make sure to raise exception if redis is not there (infiniflow#674)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

### Type of change

- [x] Refactoring
  • Loading branch information
KevinHuSh authored May 8, 2024
1 parent 741c934 commit c905fd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions api/apps/llm_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@ def add_llm():
return get_json_result(data=True)


@manager.route('/delete_llm', methods=['POST'])
@login_required
@validate_request("llm_factory", "llm_name")
def delete_llm():
req = request.json
TenantLLMService.filter_delete(
[TenantLLM.tenant_id == current_user.id, TenantLLM.llm_factory == req["llm_factory"], TenantLLM.llm_name == req["llm_name"]])
return get_json_result(data=True)


@manager.route('/my_llms', methods=['GET'])
@login_required
def my_llms():
Expand Down
2 changes: 1 addition & 1 deletion api/db/services/task_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ def new_task():
DocumentService.begin2parse(doc["id"])

for t in tsks:
REDIS_CONN.queue_product(SVR_QUEUE_NAME, message=t)
assert REDIS_CONN.queue_product(SVR_QUEUE_NAME, message=t), "Can't access Redis. Please check the Redis' status."

0 comments on commit c905fd0

Please sign in to comment.