Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
948633d4
Commit
948633d4
authored
Apr 17, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make number of workers tuneable by an env var
parent
de59d5c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
workers.go
workers.go
+14
-1
No files found.
workers.go
View file @
948633d4
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment