Files
zt-closet-backend/internal/redismodel/airecommend.go
T
2026-09-15 23:04:13 +08:00

13 lines
585 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package redismodel
// AI 穿搭推荐异步任务。
//
// 推荐生成被拆成「提交任务 + 后台执行 + 前端轮询」:
// - 活跃位复用 KeyLockAIRecommend(lock:ai:recommend:%d),值为进行中的 task_id,
// 既做同一用户互斥,也让重复提交能拿回同一个任务而不是报「请求过于频繁」;
// - 任务快照独立存储,供前端按 task_id 轮询,生命周期不绑定 HTTP 连接。
const (
// KeyAIRecommendTask 任务快照(JSON),task_id 维度。
KeyAIRecommendTask = RedisPrefix + "ai:recommend:task:%s"
)