|
@@ -32,8 +32,14 @@ def _import_worker():
|
|
|
task_id, tmp_path, import_type, source_name, config = task
|
|
task_id, tmp_path, import_type, source_name, config = task
|
|
|
try:
|
|
try:
|
|
|
_process_import(task_id, tmp_path, import_type, source_name, config)
|
|
_process_import(task_id, tmp_path, import_type, source_name, config)
|
|
|
- except Exception:
|
|
|
|
|
- pass
|
|
|
|
|
|
|
+ except Exception as e:
|
|
|
|
|
+ conn = get_connection(config.db_path)
|
|
|
|
|
+ try:
|
|
|
|
|
+ update_import_task(conn, task_id, status="error", message=str(e))
|
|
|
|
|
+ except Exception:
|
|
|
|
|
+ pass
|
|
|
|
|
+ finally:
|
|
|
|
|
+ conn.close()
|
|
|
_import_queue.task_done()
|
|
_import_queue.task_done()
|
|
|
|
|
|
|
|
# 启动后台工作线程
|
|
# 启动后台工作线程
|