添加 embedding 错误处理
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user