1
This commit is contained in:
@@ -15,6 +15,11 @@ function pick_asin_from_url(url) {
|
||||
return m && m[1] ? m[1].toUpperCase() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 以“自然日(本地时区)”为口径判断当天是否已抓取过详情。
|
||||
* - 详情数据写入 `amazon_product`,会更新 `updated_at`
|
||||
* - 当 `updated_at >= 今日 00:00` 时,后续同日任务将跳过详情提取(仅抓评论)
|
||||
*/
|
||||
function get_today_start() {
|
||||
const d = new Date();
|
||||
d.setHours(0, 0, 0, 0);
|
||||
@@ -214,6 +219,11 @@ export async function run_amazon_search_detail_reviews_flow(flow_payload) {
|
||||
const asin = pick_asin_from_url(url);
|
||||
const skip_detail = asin ? await has_detail_fetched_today(asin) : false;
|
||||
|
||||
/**
|
||||
* 合并 action:同一详情页 tab 内一次完成 detail + reviews(减少两次打开页面/两次桥接调用)
|
||||
* - 当 skip_detail=true:插件只返回 reviews(detail 不执行/不返回)
|
||||
* - 返回结构:{ result: { detail?: {...}, reviews: {...} } }
|
||||
*/
|
||||
const res = await execute_action_and_record({
|
||||
action_name: 'amazon_product_detail_reviews',
|
||||
action_payload: { product_url: url, limit: reviews_limit, skip_detail },
|
||||
|
||||
Reference in New Issue
Block a user