Skip to content

Commit

Permalink
Update pipeline.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris-code authored Aug 18, 2021
1 parent 9dfaf33 commit b6164f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source_code/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pipeline是数据入库时流经的管道,默认为使用mysql入库,用户可自定义,以便对接其他数据库。

注:AirSpider不支持
注:item会被聚合成多条一起流经pipeline,方便批量入库

## 使用方式

Expand Down Expand Up @@ -52,7 +52,7 @@ class Pipeline(BasePipeline):
return True
```

`Pipeline`需继承`BasePipeline`,类名和存放位置随意,需要实现`save_items`接口。一定要有返回值,返回`False`表示数据没保存成功,数据不入去重库,以便再次入库
`Pipeline`需继承`BasePipeline`,类名和存放位置随意,需要实现`save_items`接口。一定要有返回值,返回`False`表示数据没保存成功,会触发重试逻辑

`update_items`接口与`UpdateItem`配合使用,更新数据时使用,若爬虫中没使用UpdateItem,则可不实现此接口

Expand All @@ -69,4 +69,4 @@ ITEM_PIPELINES = [

## 示例

地址:https://github.com/Boris-code/feapder/tree/master/tests/test-pipeline
地址:https://github.com/Boris-code/feapder/tree/master/tests/test-pipeline

0 comments on commit b6164f6

Please sign in to comment.