|
@@ -43,5 +43,19 @@ class RabbitMqPipeline(BasePipeline):
|
|
|
log.exception(e)
|
|
|
return False
|
|
|
|
|
|
+ def update_items(self, table, items: List[Dict], **kwargs) -> bool:
|
|
|
+ """
|
|
|
+ 更新数据
|
|
|
+ Args:
|
|
|
+ table: 表名
|
|
|
+ items: 数据,[{},{},...]
|
|
|
+
|
|
|
+ Returns: 是否更新成功 True / False
|
|
|
+ 若False,不会将本批数据入到去重库,以便再次入库
|
|
|
+
|
|
|
+ """
|
|
|
+ items = [{'amq_update': items}]
|
|
|
+ return self.save_items(table, items)
|
|
|
+
|
|
|
def close(self):
|
|
|
self.to_db.close()
|