()
| 23 | |
| 24 | |
| 25 | def 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') |
nothing calls this directly
no test coverage detected