Show upload status and log KDocs skips

This commit is contained in:
2026-01-07 14:28:58 +08:00
parent 703a62b6ad
commit 45cbdc51b4
3 changed files with 43 additions and 3 deletions

View File

@@ -400,14 +400,20 @@ def take_screenshot_for_account(
name = (account.remark or "").strip()
if unit and name:
from services.kdocs_uploader import get_kdocs_uploader
get_kdocs_uploader().enqueue_upload(
ok = get_kdocs_uploader().enqueue_upload(
user_id=user_id,
account_id=account_id,
unit=unit,
name=name,
image_path=screenshot_path,
)
if not ok:
log_to_client("表格上传排队失败: 队列已满", user_id, account_id)
else:
if not unit:
log_to_client("表格上传跳过: 未配置县区", user_id, account_id)
if not name:
log_to_client("表格上传跳过: 账号备注为空", user_id, account_id)
except Exception as kdocs_error:
logger.warning(f"表格上传任务提交失败: {kdocs_error}")