Skip to content

Commit

Permalink
fix 重复获取爬虫的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wo10378931 committed Sep 27, 2019
1 parent bc6dc22 commit c69d5ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/model/spider.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ func GetSpiderByName(name string) *Spider {
defer s.Close()

var result *Spider
if err := c.Find(bson.M{"name": name}).One(result); err != nil {
if err := c.Find(bson.M{"name": name}).One(&result); err != nil {
log.Errorf("get spider error: %s, spider_name: %s", err.Error(), name)
debug.PrintStack()
return result
return nil
}
return result
}
Expand Down

0 comments on commit c69d5ee

Please sign in to comment.