start meilisearch in ide.py
This commit is contained in:
parent
d2afe5ff25
commit
6e0c1dece5
2 changed files with 8 additions and 8 deletions
|
|
@ -10,6 +10,7 @@ from pydantic import BaseModel
|
|||
import traceback
|
||||
import asyncio
|
||||
|
||||
from .meilisearch_server import start_meilisearch
|
||||
from ..libs.util.telemetry import posthog_logger
|
||||
from ..libs.util.queue import AsyncSubscriptionQueue
|
||||
from ..models.filesystem import FileSystem, RangeInFile, EditDiff, RangeInFileWithContents, RealFileSystem
|
||||
|
|
@ -434,6 +435,13 @@ class IdeProtocolServer(AbstractIdeProtocolServer):
|
|||
@router.websocket("/ws")
|
||||
async def websocket_endpoint(websocket: WebSocket, session_id: str = None):
|
||||
try:
|
||||
# Start meilisearch
|
||||
try:
|
||||
await start_meilisearch()
|
||||
except Exception as e:
|
||||
print("Failed to start MeiliSearch")
|
||||
print(e)
|
||||
|
||||
await websocket.accept()
|
||||
print("Accepted websocket connection from, ", websocket.client)
|
||||
await websocket.send_json({"messageType": "connected", "data": {}})
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import asyncio
|
||||
import time
|
||||
from meilisearch_python_async import Client
|
||||
import psutil
|
||||
import os
|
||||
from fastapi import FastAPI
|
||||
|
|
@ -12,7 +11,6 @@ import argparse
|
|||
from .ide import router as ide_router
|
||||
from .gui import router as gui_router
|
||||
from .session_manager import session_manager
|
||||
from .meilisearch_server import start_meilisearch
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
|
@ -86,12 +84,6 @@ if __name__ == "__main__":
|
|||
# cpu_thread = threading.Thread(target=cpu_usage_loop)
|
||||
# cpu_thread.start()
|
||||
|
||||
# try:
|
||||
# await start_meilisearch()
|
||||
# except Exception as e:
|
||||
# print("Failed to start MeiliSearch")
|
||||
# print(e)
|
||||
|
||||
run_server()
|
||||
except Exception as e:
|
||||
print("Error starting Continue server: ", e)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue