添加 embedding 错误处理
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import traceback
|
||||
import datetime
|
||||
import asyncio
|
||||
from sqlalchemy.sql.ddl import exc
|
||||
import tqdm
|
||||
import os
|
||||
from tokenizers import Tokenizer
|
||||
@@ -164,8 +166,12 @@ async def get_embedding_from_cache(hash: str) -> list[float] | None:
|
||||
async def main():
|
||||
await pool.open()
|
||||
while True:
|
||||
await do_update()
|
||||
await asyncio.sleep(60)
|
||||
try:
|
||||
await do_update()
|
||||
except Exception as e:
|
||||
print(traceback.format_exc())
|
||||
finally:
|
||||
await asyncio.sleep(60)
|
||||
|
||||
async def do_update():
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user