Commit 948633d4 authored by Jeromy's avatar Jeromy

make number of workers tuneable by an env var

parent de59d5c1
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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment