添加 embedding 错误处理

This commit is contained in:
2024-09-19 14:27:42 +08:00
parent 92e3699cd8
commit 0b658dee88

View File

@@ -1,5 +1,7 @@
import traceback
import datetime import datetime
import asyncio import asyncio
from sqlalchemy.sql.ddl import exc
import tqdm import tqdm
import os import os
from tokenizers import Tokenizer from tokenizers import Tokenizer
@@ -164,8 +166,12 @@ async def get_embedding_from_cache(hash: str) -> list[float] | None:
async def main(): async def main():
await pool.open() await pool.open()
while True: while True:
await do_update() try:
await asyncio.sleep(60) await do_update()
except Exception as e:
print(traceback.format_exc())
finally:
await asyncio.sleep(60)
async def do_update(): async def do_update():
while True: while True: