feat(meituan-coupon): 采集记录头图大小/类型 + 读取侧缩放口子 + 回填脚本 #71

Merged
marco merged 2 commits from intern/chenshuobo/meituan-coupon-image-size-20260623 into main 2026-06-23 21:09:11 +08:00
No description provided.
Ghost added 2 commits 2026-06-23 20:37:20 +08:00
- meituan_coupon 加 image_size(字节)/image_type(MIME)两列 + alembic 迁移(nullable,不动存量)
- ETL 每城抓完后按 head_url 去重并发 HEAD 回填两列(失败→NULL 不阻断,实测 +~9s/城)
- 读取侧 feed_image_url 口子:按 image_size 阈值决定是否给图 URL 拼缩放参数(124dp+WebP,
  实测省 76–99%);阈值默认 None=passthrough、行为不变,待产品定阈值
- upsert update 列自动含两列,重抓即回填,无需手动 backfill;附 deploy/backfill_image_meta.sh
  供上线后服务器手动全量回填一次

验证:迁移 upgrade + 口子单测 + 本地全量 359 城重跑(727094 行、99.99% 填充;
GIF 仅 708 张但 avg 4.8MB/max 10MB,印证长尾)
产品要求所有头图都压缩,不再按 image_size 阈值判定:
- feed_image_url 改为无条件给图片 URL 拼 @375w_375h_1e_1c.webp(缩 124dp + 转 WebP)
- 去掉 FEED_THUMB_SIZE_THRESHOLD 阈值常量;from_raw / 两处 DB 路不再传 image_size
- image_size/image_type 两列保留用于分析/监控(GIF 占比、体积分布),采集逻辑不变
- 文档更新:head_image_url 现统一带缩放参数

注:读取侧统一压缩,部署后即对全部 feed 图生效,无需依赖 image_size 回填。
marco merged commit b07ccb4bf5 into main 2026-06-23 21:09:11 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WonderableAI/shaguabijia-app-server#71