V10.403 widen retryable PChome revalidation
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s
This commit is contained in:
@@ -1006,12 +1006,12 @@ class CompetitorPriceFeeder:
|
||||
|
||||
def _fetch_retryable_candidate_skus(self, limit: int = 80, min_score: float = 0.70) -> list:
|
||||
"""
|
||||
取得近門檻且非 hard veto 的候選,供 matcher 升級後重新評分。
|
||||
取得近門檻候選,供 matcher 升級後重新評分。
|
||||
|
||||
這條路徑不重新搜尋,只用前次留下的 PChome product_id 批次查詢最新商品資料,
|
||||
適合把舊 scorer 卡在 0.70~0.759 的真同款重新推進正式比價。
|
||||
僅重跑明顯仍在 exact identity 軌道內、具回收價值的候選;
|
||||
真正低信心與 hard veto 不再反覆空轉。
|
||||
僅重跑明顯有回收價值的候選;最後仍由現行 matcher 重新判斷,
|
||||
不因舊 attempt_status 自動寫入正式比價。
|
||||
"""
|
||||
if self.engine is None:
|
||||
raise RuntimeError("需要注入 SQLAlchemy engine")
|
||||
@@ -1064,11 +1064,22 @@ class CompetitorPriceFeeder:
|
||||
AND COALESCE(cp.tags, '[]'::jsonb) ? 'identity_v2'
|
||||
WHERE lm.rn = 1
|
||||
AND cp.sku IS NULL
|
||||
AND la.attempt_status IN ('low_score', 'refresh_low_score', 'recoverable_low_score')
|
||||
AND la.attempt_status IN (
|
||||
'low_score',
|
||||
'refresh_low_score',
|
||||
'recoverable_low_score',
|
||||
'true_low_confidence',
|
||||
'unit_comparable',
|
||||
'refresh_unit_comparable',
|
||||
'identity_veto'
|
||||
)
|
||||
AND la.best_competitor_product_id IS NOT NULL
|
||||
AND la.best_competitor_product_id <> ''
|
||||
AND COALESCE(la.best_match_score, 0) >= :min_score
|
||||
AND COALESCE(la.hard_veto, false) = false
|
||||
AND (
|
||||
COALESCE(la.hard_veto, false) = false
|
||||
OR la.attempt_status = 'identity_veto'
|
||||
)
|
||||
ORDER BY la.best_match_score DESC NULLS LAST, lm.momo_price DESC NULLS LAST, lm.sku
|
||||
LIMIT :limit
|
||||
""")
|
||||
|
||||
Reference in New Issue
Block a user