|
|
@ -2,23 +2,13 @@ package main |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"runtime" |
|
|
|
|
|
"strconv" |
|
|
"strconv" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/docopt/docopt-go" |
|
|
"github.com/docopt/docopt-go" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var defaultConcurrency = func() int { |
|
|
const defaultConcurrency = maxOpenFiles / 2 |
|
|
const max = maxOpenFiles / 2 |
|
|
|
|
|
n := 8 * runtime.NumCPU() // 8 is an empirical value.
|
|
|
|
|
|
|
|
|
|
|
|
if n < max { |
|
|
|
|
|
return n |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return max |
|
|
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
|
const usage = `Link checker for Markdown and HTML |
|
|
const usage = `Link checker for Markdown and HTML |
|
|
|
|
|
|
|
|
|