refactoring
This commit is contained in:
parent
91475c2c4d
commit
31bbc97f9b
@ -64,6 +64,9 @@ func (p *pageParser) parse() (*models.TaskResult, error) {
|
||||
}
|
||||
result.Items = append(result.Items, item)
|
||||
}
|
||||
if len(result.Items) == 0 {
|
||||
return nil, fmt.Errorf("extract failed for all posts")
|
||||
}
|
||||
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
@ -287,9 +287,6 @@ func (e *PwExtractor) Extract(task models.Task) (result *models.TaskResult, errR
|
||||
if err != nil {
|
||||
return fmt.Errorf("parse page: %w", err)
|
||||
}
|
||||
if len(result.Items) == 0 {
|
||||
return fmt.Errorf("extract failed for all posts")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user