Skip to content

Commit

Permalink
Refactor checker (#105)
Browse files Browse the repository at this point in the history
* Refactor checker

* Bump version
  • Loading branch information
raviqqe authored Sep 24, 2020
1 parent e278193 commit 4ac3bfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ func (c *checker) checkPage(p *page) {
ec <- &errorLinkResult{u, err}
}

if !c.onePageOnly && p != nil && c.linkValidator.Validate(p.URL()) {
if !c.onePageOnly &&
p != nil &&
c.linkValidator.Validate(p.URL()) &&
!c.donePages.Add(p.URL().String()) {
c.addPage(p)
}
}(u)
Expand All @@ -88,7 +91,5 @@ func (c *checker) checkPage(p *page) {
}

func (c *checker) addPage(p *page) {
if !c.donePages.Add(p.URL().String()) {
c.daemonManager.Add(func() { c.checkPage(p) })
}
c.daemonManager.Add(func() { c.checkPage(p) })
}
2 changes: 1 addition & 1 deletion configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import "time"

const (
version = "1.5.6"
version = "1.5.7"
defaultBufferSize = 4096
defaultConcurrency = 512
defaultMaxRedirections = 64
Expand Down

0 comments on commit 4ac3bfc

Please sign in to comment.