|
|
@@ -90,16 +90,16 @@ class ArticleSearchRelationMapper(DemandSearchArticleConst):
|
|
|
|
|
|
items 每条须包含:
|
|
|
search_key, key_type, experiment_id, search_cursor,
|
|
|
- url, wx_sn, title, cover_url, publish_time
|
|
|
+ url, wx_sn, biz, title, cover_url, publish_time
|
|
|
"""
|
|
|
if not items:
|
|
|
return 0
|
|
|
query = f"""
|
|
|
INSERT IGNORE INTO {self.RELATION_TABLE}
|
|
|
(search_key, key_type, experiment_id, search_cursor,
|
|
|
- url, wx_sn, title, cover_url, publish_time)
|
|
|
+ url, wx_sn, biz, title, cover_url, publish_time)
|
|
|
VALUES
|
|
|
- (%s, %s, %s, %s, %s, %s, %s, %s, %s)
|
|
|
+ (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
|
|
|
"""
|
|
|
params = [
|
|
|
(
|
|
|
@@ -109,6 +109,7 @@ class ArticleSearchRelationMapper(DemandSearchArticleConst):
|
|
|
it["search_cursor"],
|
|
|
it["url"],
|
|
|
it["wx_sn"],
|
|
|
+ it["biz"],
|
|
|
it["title"],
|
|
|
it["cover_url"],
|
|
|
it["publish_time"],
|
|
|
@@ -123,7 +124,6 @@ class ArticleSearchRelationMapper(DemandSearchArticleConst):
|
|
|
|
|
|
async def fetch_pending(
|
|
|
self,
|
|
|
- experiment_id: str,
|
|
|
*,
|
|
|
limit: int = 500,
|
|
|
) -> List[Dict]:
|
|
|
@@ -131,13 +131,11 @@ class ArticleSearchRelationMapper(DemandSearchArticleConst):
|
|
|
query = f"""
|
|
|
SELECT *
|
|
|
FROM {self.RELATION_TABLE}
|
|
|
- WHERE experiment_id = %s AND status = %s
|
|
|
+ WHERE status = %s
|
|
|
LIMIT %s
|
|
|
"""
|
|
|
- return await self.pool.fetch(
|
|
|
- query=query,
|
|
|
- params=(experiment_id, self.SearchStatus.INIT, limit),
|
|
|
- )
|
|
|
+ params = (self.SearchStatus.INIT, limit)
|
|
|
+ return await self.pool.fetch(query=query, params=params)
|
|
|
|
|
|
async def count_by_status(
|
|
|
self,
|