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-datastore
Commits
85cba2da
Commit
85cba2da
authored
Jun 30, 2016
by
Jeromy Johnson
Committed by
GitHub
Jun 30, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #43 from ipfs/kevina/128
Set the channel buffer size to 128 for KeysOnly queries.
parents
dcac9354
c33fc953
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
flatfs/flatfs.go
flatfs/flatfs.go
+1
-1
query/query.go
query/query.go
+7
-1
No files found.
flatfs/flatfs.go
View file @
85cba2da
...
...
@@ -309,7 +309,7 @@ func (fs *Datastore) Query(q query.Query) (query.Results, error) {
return
nil
,
errors
.
New
(
"flatfs only supports listing all keys in random order"
)
}
reschan
:=
make
(
chan
query
.
Result
)
reschan
:=
make
(
chan
query
.
Result
,
query
.
KeysOnlyBufSize
)
go
func
()
{
defer
close
(
reschan
)
err
:=
filepath
.
Walk
(
fs
.
path
,
func
(
path
string
,
info
os
.
FileInfo
,
err
error
)
error
{
...
...
query/query.go
View file @
85cba2da
...
...
@@ -179,10 +179,16 @@ func (rb *ResultBuilder) Results() Results {
}
}
const
KeysOnlyBufSize
=
128
func
NewResultBuilder
(
q
Query
)
*
ResultBuilder
{
bufSize
:=
1
if
q
.
KeysOnly
{
bufSize
=
KeysOnlyBufSize
}
b
:=
&
ResultBuilder
{
Query
:
q
,
Output
:
make
(
chan
Result
),
Output
:
make
(
chan
Result
,
bufSize
),
}
b
.
Process
=
goprocess
.
WithTeardown
(
func
()
error
{
close
(
b
.
Output
)
...
...
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