提交 3629d7d5 作者: Jeromy

make number of workers tuneable by an env var

上级 3178dfe7
package bitswap
import (
"os"
"strconv"
"time"
inflect "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/chuckpreslar/inflect"
......@@ -9,7 +11,18 @@ import (
u "github.com/ipfs/go-ipfs/util"
)
var TaskWorkerCount = 4
var TaskWorkerCount = 16
func init() {
twc := os.Getenv("IPFS_TASK_WORKERS")
if twc != "" {
n, err := strconv.Atoi(twc)
if err != nil {
return
}
TaskWorkerCount = n
}
}
func (bs *Bitswap) startWorkers(px process.Process, ctx context.Context) {
// Start up a worker to handle block requests this node is making
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论