fix: 🚑 catch error from meilisearch client.health
This commit is contained in:
parent
f60f867cfa
commit
00775f54e6
4 changed files with 19 additions and 8 deletions
|
|
@ -136,8 +136,16 @@ class ContextManager:
|
|||
@classmethod
|
||||
async def create(cls, context_providers: List[ContextProvider]):
|
||||
async with Client('http://localhost:7700') as search_client:
|
||||
health = await search_client.health()
|
||||
if not health.status == "available":
|
||||
meilisearch_running = True
|
||||
try:
|
||||
|
||||
health = await search_client.health()
|
||||
if not health.status == "available":
|
||||
meilisearch_running = False
|
||||
except:
|
||||
meilisearch_running = False
|
||||
|
||||
if not meilisearch_running:
|
||||
print(
|
||||
"MeiliSearch not running, avoiding any dependent context providers")
|
||||
context_providers = list(
|
||||
|
|
|
|||
|
|
@ -55,10 +55,13 @@ async def check_meilisearch_running() -> bool:
|
|||
|
||||
try:
|
||||
async with Client('http://localhost:7700') as client:
|
||||
resp = await client.health()
|
||||
if resp["status"] != "available":
|
||||
try:
|
||||
resp = await client.health()
|
||||
if resp["status"] != "available":
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
return False
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
|
|
|||
4
extension/package-lock.json
generated
4
extension/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.0.206",
|
||||
"version": "0.0.207",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.0.206",
|
||||
"version": "0.0.207",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"displayName": "Continue",
|
||||
"pricing": "Free",
|
||||
"description": "The open-source coding autopilot",
|
||||
"version": "0.0.206",
|
||||
"version": "0.0.207",
|
||||
"publisher": "Continue",
|
||||
"engines": {
|
||||
"vscode": "^1.67.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue