MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / run

Function run

apps/common/event/__init__.py:25–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def run():
26 from models_provider.models import Model, Status
27 rlock = RedisLock()
28 if rlock.try_lock('event_init', 30 * 30):
29 try:
30 # 修改Model状态为ERROR
31 QuerySet(Model).filter(
32 status=Status.DOWNLOAD
33 ).update(
34 status=Status.ERROR, meta={'message': _('The download process was interrupted, please try again')}
35 )
36 # 更新文档状态
37 update_execute(update_document_status_sql, [])
38 version, get_key = Cache_Version.SYSTEM.value
39 cache.delete(get_key(key='rsa_key'), version=version)
40 finally:
41 rlock.un_lock('event_init')

Callers

nothing calls this directly

Calls 5

try_lockMethod · 0.95
un_lockMethod · 0.95
RedisLockClass · 0.85
update_executeFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected