fix: 修复向量化失败,缓存未被删除 (#887)
This commit is contained in:
parent
3c7142ed7c
commit
6aa2a682bc
@ -13,6 +13,6 @@ from .listener_manage import *
|
|||||||
|
|
||||||
def run():
|
def run():
|
||||||
listener_manage.ListenerManagement().run()
|
listener_manage.ListenerManagement().run()
|
||||||
QuerySet(Document).filter(status=Status.embedding).update(**{'status': Status.error})
|
QuerySet(Document).filter(status__in=[Status.embedding, Status.queue_up]).update(**{'status': Status.error})
|
||||||
QuerySet(Model).filter(status=setting.models.Status.DOWNLOAD).update(status=setting.models.Status.ERROR,
|
QuerySet(Model).filter(status=setting.models.Status.DOWNLOAD).update(status=setting.models.Status.ERROR,
|
||||||
meta={'message': "下载程序被中断,请重试"})
|
meta={'message': "下载程序被中断,请重试"})
|
||||||
|
|||||||
@ -30,8 +30,10 @@ def get_cache_key(poxy_function, args):
|
|||||||
|
|
||||||
def get_cache_poxy_function(poxy_function, cache_key):
|
def get_cache_poxy_function(poxy_function, cache_key):
|
||||||
def fun(args, **keywords):
|
def fun(args, **keywords):
|
||||||
poxy_function(args, **keywords)
|
try:
|
||||||
memory_cache.delete(cache_key)
|
poxy_function(args, **keywords)
|
||||||
|
finally:
|
||||||
|
memory_cache.delete(cache_key)
|
||||||
|
|
||||||
return fun
|
return fun
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user