fix: 🚑 catch error from meilisearch client.health

This commit is contained in:
Nate Sesti 2023-07-26 12:53:50 -07:00
parent f60f867cfa
commit 00775f54e6
4 changed files with 19 additions and 8 deletions

View file

@ -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(

View file

@ -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

View file

@ -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",

View file

@ -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"